From e9dcc16f16cc43fdd89eec6da6b7fc045c9f3324 Mon Sep 17 00:00:00 2001 From: vrld Date: Mon, 10 Sep 2012 12:39:37 +0200 Subject: [PATCH] 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. --- src/common/Module.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/Module.cpp b/src/common/Module.cpp index 48f220fa8..6970bb37f 100644 --- a/src/common/Module.cpp +++ b/src/common/Module.cpp @@ -42,8 +42,13 @@ namespace love std::string name(instance->getName()); std::map::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)); }