diff --git a/Jupiter/GenericCommand.cpp b/Jupiter/GenericCommand.cpp index f63ce27..c6aa817 100644 --- a/Jupiter/GenericCommand.cpp +++ b/Jupiter/GenericCommand.cpp @@ -32,12 +32,7 @@ Jupiter::GenericCommandNamespace &Jupiter::g_generic_commands = o_generic_comman Jupiter::GenericCommand::GenericCommand() { if (&o_generic_commands != this) - { Jupiter::GenericCommand::setNamespace(o_generic_commands); - - for (size_t index = 0; index != Jupiter::plugins->size(); ++index) - Jupiter::plugins->get(index)->OnGenericCommandAdd(*this); - } } Jupiter::GenericCommand::~GenericCommand() diff --git a/Jupiter/GenericCommand.h b/Jupiter/GenericCommand.h index a9523a9..e3be25c 100644 --- a/Jupiter/GenericCommand.h +++ b/Jupiter/GenericCommand.h @@ -180,8 +180,14 @@ class CLASS : public Jupiter::GenericCommand { \ /** Instantiates a generic command. */ #define GENERIC_COMMAND_INIT(CLASS) \ - CLASS CLASS :: instance = CLASS (); \ - CLASS & CLASS ## _instance = CLASS :: instance; +class CLASS ## _Init : public CLASS { \ +public: \ + CLASS ## _Init() { \ + for (size_t index = 0; index != Jupiter::plugins->size(); ++index) \ + Jupiter::plugins->get(index)->OnGenericCommandAdd(*this); \ + } }; \ + CLASS ## _Init CLASS ## _instance = CLASS ## _Init (); \ + CLASS & CLASS :: instance = CLASS ## _instance; /** Re-enable warnings */ #if defined _MSC_VER diff --git a/Release/Jupiter.lib b/Release/Jupiter.lib index a79dd6e..0b3098a 100644 Binary files a/Release/Jupiter.lib and b/Release/Jupiter.lib differ