mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Don't throw exception when loading module in thread.
The module registry throws an exception when trying to register a module instances if an instance is already registered under the same name. This backfired in love.thread when requiring love-modules.
This commit is contained in:
@@ -42,8 +42,13 @@ namespace love
|
||||
std::string name(instance->getName());
|
||||
|
||||
std::map<std::string, Module*>::iterator it = registry.find(name);
|
||||
|
||||
if (registry.end() != it)
|
||||
{
|
||||
if (it->second == instance)
|
||||
return;
|
||||
throw Exception("Module %s already registered!", instance->getName());
|
||||
}
|
||||
|
||||
registry.insert(make_pair(name, instance));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user