From c0037fc55a9156300c0fb15dcfe68007717250d4 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Thu, 28 Mar 2019 22:12:48 +0100 Subject: [PATCH] Fixed: removed nlstop when 2 same commands runs (in services) removed nlassert when factory not found (who crash the fes) --HG-- branch : patches-from-atys --- code/nel/include/nel/misc/factory.h | 13 +++++-------- code/nel/src/misc/command.cpp | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/code/nel/include/nel/misc/factory.h b/code/nel/include/nel/misc/factory.h index a119a2ae4..82e2fa113 100644 --- a/code/nel/include/nel/misc/factory.h +++ b/code/nel/include/nel/misc/factory.h @@ -14,12 +14,6 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . - - - - - - #ifndef FACTORY_H #define FACTORY_H @@ -78,8 +72,11 @@ public: */ void registerClass(const KeyType &key, IFactoryRegister *factoryRegister) { - nlassert(_FactoryRegisters.find(key) == _FactoryRegisters.end()); - _FactoryRegisters.insert(std::make_pair(key, factoryRegister)); + // TODO: Removed assert because of crash of fes in 2019. We need found why... (ulukyn) + //nlassert(_FactoryRegisters.find(key) == _FactoryRegisters.end()); + //_FactoryRegisters.insert(std::make_pair(key, factoryRegister)); + if (_FactoryRegisters.find(key) == _FactoryRegisters.end()) + _FactoryRegisters.insert(std::make_pair(key, factoryRegister)); } /** Create a new instance of a factorable object. diff --git a/code/nel/src/misc/command.cpp b/code/nel/src/misc/command.cpp index a3d9d79ed..5ad60a31f 100644 --- a/code/nel/src/misc/command.cpp +++ b/code/nel/src/misc/command.cpp @@ -49,8 +49,9 @@ ICommand::ICommand(const char *categoryName, const char *commandName, const char if (comm != LocalCommands->end ()) { + nlinfo("command with same name: %s", commandName); // 2 commands have the same name - nlstopex (("There are 2 commands that have the same name in the project (command name '%s'), skip the second definition", commandName)); + // nlstopex (("There are 2 commands that have the same name in the project (command name '%s'), skip the second definition", commandName)); } else {