summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/init.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-07 17:42:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-07 17:42:55 +0000
commit81c987f5b850447389b2621037a364c3fcb0ba73 (patch)
treead5163f5e6bc65fd31e39d530cf975eb9d059bf2 /protocols/IcqOscarJ/src/init.cpp
parent44d6a1fff311d6d4784f325ed4ae412eda64c8c6 (diff)
crash fix on exit
git-svn-id: http://svn.miranda-ng.org/main/trunk@13479 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/init.cpp')
-rw-r--r--protocols/IcqOscarJ/src/init.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index 67d5626749..d80eba68a2 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -32,6 +32,7 @@ HINSTANCE hInst;
int hLangpack;
TIME_API tmi;
CLIST_INTERFACE *pcli;
+bool g_bTerminated;
BOOL bPopupService = FALSE;
@@ -85,6 +86,12 @@ int ModuleLoad(WPARAM, LPARAM)
return 0;
}
+static int OnPreShutdown(WPARAM, LPARAM)
+{
+ g_bTerminated = true;
+ return 0;
+}
+
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
@@ -115,6 +122,8 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+
hExtraXStatus = ExtraIcon_Register("xstatus", LPGEN("ICQ xStatus"), "icq_xstatus13");
g_MenuInit();