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:
vrld
2012-09-10 12:39:37 +02:00
parent 8234e71c74
commit e9dcc16f16
+5
View File
@@ -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));
}