From 5f3e3abd23f5ec503976885a073aae2c2a276ade Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 24 Nov 2014 14:19:23 +0000 Subject: - fix for thread control in Popup+; - fix for a very specific crash on exit in MTextControl; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@11048 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins/Popup/src/main.cpp') diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 3f97bf29f9..19a01e7224 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -319,7 +319,6 @@ MIRAPI PLUGININFOEX* MirandaPluginInfoEx(DWORD) return &pluginInfoEx; } -//ME_SYSTEM_PRESHUTDOWN event //called before the app goes into shutdown routine to make sure everyone is happy to exit static int OkToExit(WPARAM, LPARAM) { @@ -328,6 +327,13 @@ static int OkToExit(WPARAM, LPARAM) return 0; } +static int OnShutdown(WPARAM, LPARAM) +{ + UnloadPopupThread(); + UnloadPopupWnd2(); + return 0; +} + //===== Load ===== //Initializes the services provided and the link to those needed //Called when the plugin is loaded into Miranda @@ -367,6 +373,7 @@ MIRAPI int Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); HookEvent(ME_OPT_INITIALISE, OptionsInitialize); HookEvent(ME_SYSTEM_PRESHUTDOWN, OkToExit); + HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown); hbmNoAvatar = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_NOAVATAR)); @@ -437,8 +444,6 @@ MIRAPI int Unload(void) mir_free(PopupOptions.Effect); OptAdv_UnregisterVfx(); - UnloadPopupThread(); - UnloadPopupWnd2(); PopupHistoryUnload(); SrmmMenu_Unload(); -- cgit v1.2.3