summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/miranda.cpp2
-rw-r--r--src/modules/plugins/newplugins.cpp10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp
index 4ee236537f..be4a7691f5 100644
--- a/src/core/miranda.cpp
+++ b/src/core/miranda.cpp
@@ -86,6 +86,7 @@ static int waitObjectCount = 0;
HANDLE hMirandaShutdown;
HINSTANCE hInst;
int hLangpack = 0;
+bool bModulesLoadedFired = false;
/////////////////////////////////////////////////////////////////////////////////////////
// exception handling
@@ -298,6 +299,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
goto exit;
}
NotifyEventHooks(hModulesLoadedEvent, 0, 0);
+ bModulesLoadedFired = true;
// ensure that the kernel hooks the SystemShutdownProc() after all plugins
HookEvent(ME_SYSTEM_SHUTDOWN, SystemShutdownProc);
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 04ac293b97..7e4e9ac80c 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "..\..\core\commonheaders.h"
#include "plugins.h"
+extern bool bModulesLoadedFired;
+
static int sttComparePluginsByName(const pluginEntry* p1, const pluginEntry* p2)
{ return lstrcmp(p1->pluginname, p2->pluginname);
}
@@ -607,11 +609,13 @@ LBL_Error:
if ( !TryLoadPlugin(pPlug, true))
goto LBL_Error;
- if (CallPluginEventHook(pPlug->bpi.hInst, hModulesLoadedEvent, 0, 0) != 0)
- goto LBL_Error;
+ if (bModulesLoadedFired) {
+ if (CallPluginEventHook(pPlug->bpi.hInst, hModulesLoadedEvent, 0, 0) != 0)
+ goto LBL_Error;
+ NotifyEventHooks(hevLoadModule, (WPARAM)pPlug->bpi.InfoEx, (LPARAM)pPlug->bpi.hInst);
+ }
mr.pImpl = pPlug;
- NotifyEventHooks(hevLoadModule, (WPARAM)pPlug->bpi.InfoEx, (LPARAM)pPlug->bpi.hInst);
return TRUE;
}