vrld committed 05f0d0e

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.

Comments (0)

Files changed (1)


 		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));