summaryrefslogtreecommitdiff
path: root/protocols/MRA/src/Mra.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-02-09 16:46:03 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-02-09 16:46:03 +0000
commit9e6567e9498724b3781768a8c60383ad055dd02f (patch)
tree3e987afb5eb70a24acb903188c078b5710ed1259 /protocols/MRA/src/Mra.cpp
parentff22a9442b5464ef0de4273bbdeb74ea1957bf17 (diff)
simplified thread management schema for loading MRA avatars
git-svn-id: http://svn.miranda-ng.org/main/trunk@12068 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src/Mra.cpp')
-rw-r--r--protocols/MRA/src/Mra.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp
index 9f609f4056..e6c6cd3843 100644
--- a/protocols/MRA/src/Mra.cpp
+++ b/protocols/MRA/src/Mra.cpp
@@ -23,7 +23,7 @@ HINSTANCE g_hInstance;
HMODULE g_hDLLXStatusIcons;
HICON g_hMainIcon;
-bool g_bChatExist;
+bool g_bChatExist, g_bShutdown = false;
size_t g_dwMirWorkDirPathLen;
WCHAR g_szMirWorkDirPath[MAX_FILEPATH];
@@ -70,6 +70,12 @@ static int mraProtoUninit(CMraProto *ppro)
///////////////////////////////////////////////////////////////////////////////
+static int __cdecl OnPreShutdown(WPARAM, LPARAM)
+{
+ g_bShutdown = true;
+ return 0;
+}
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -78,6 +84,8 @@ extern "C" __declspec(dllexport) int Load(void)
IconsLoad();
InitXStatusIcons();
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
+
PROTOCOLDESCRIPTOR pd = { sizeof(pd) };
pd.szName = "MRA";
pd.type = PROTOTYPE_PROTOCOL;