diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-19 19:04:41 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-19 19:04:41 +0300 |
commit | 03abc0234e40183256bba3d2b9cdf809d92363f2 (patch) | |
tree | 794b80410ddb80d57094dd58706c37b4e0c27a6b /protocols/MRA/src | |
parent | 212d14abad9935d580e7073088af0f428792bdfb (diff) |
minor code cleaning
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r-- | protocols/MRA/src/Mra.cpp | 10 | ||||
-rw-r--r-- | protocols/MRA/src/MraAvatars.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/stdafx.h | 2 |
3 files changed, 4 insertions, 12 deletions
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp index 58f455fc23..46e06b3be9 100644 --- a/protocols/MRA/src/Mra.cpp +++ b/protocols/MRA/src/Mra.cpp @@ -6,7 +6,7 @@ CLIST_INTERFACE *pcli; HMODULE g_hDLLXStatusIcons;
HICON g_hMainIcon;
-bool g_bChatExist, g_bShutdown = false;
+bool g_bChatExist;
size_t g_dwMirWorkDirPathLen;
WCHAR g_szMirWorkDirPath[MAX_FILEPATH];
@@ -43,12 +43,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC ///////////////////////////////////////////////////////////////////////////////
-static int __cdecl OnPreShutdown(WPARAM, LPARAM)
-{
- g_bShutdown = true;
- return 0;
-}
-
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
@@ -56,8 +50,6 @@ extern "C" __declspec(dllexport) int Load(void) IconsLoad();
InitXStatusIcons();
-
- HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
return 0;
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index ba2f4fe98c..bbaa46ff86 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -105,7 +105,7 @@ void CMraProto::MraAvatarsQueueDestroy(HANDLE hQueue) DWORD CMraProto::MraAvatarsQueueAdd(HANDLE hQueue, DWORD dwFlags, MCONTACT hContact, DWORD *pdwAvatarsQueueID)
{
MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = (MRA_AVATARS_QUEUE*)hQueue;
- if (pmraaqAvatarsQueue == nullptr || g_bShutdown)
+ if (pmraaqAvatarsQueue == nullptr || Miranda_IsTerminated())
return ERROR_INVALID_HANDLE;
MRA_AVATARS_QUEUE_ITEM *pmraaqiAvatarsQueueItem = (MRA_AVATARS_QUEUE_ITEM*)mir_calloc(sizeof(MRA_AVATARS_QUEUE_ITEM));
@@ -152,7 +152,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) pmraaqAvatarsQueue->hThreadEvents[pmraaqAvatarsQueue->iThreadsRunning++] = hThreadEvent;
}
- while (!g_bShutdown) {
+ while (!Miranda_IsTerminated()) {
if (FifoMTItemPop(pmraaqAvatarsQueue, nullptr, (LPVOID*)&pmraaqiAvatarsQueueItem) != NO_ERROR) { // waiting until service stop or new task
NETLIB_CLOSEHANDLE(hConnection);
WaitForSingleObjectEx(hThreadEvent, INFINITE, FALSE);
diff --git a/protocols/MRA/src/stdafx.h b/protocols/MRA/src/stdafx.h index 6ee9201b4c..54860e5227 100644 --- a/protocols/MRA/src/stdafx.h +++ b/protocols/MRA/src/stdafx.h @@ -159,7 +159,7 @@ extern IconItem gdiExtraStatusIconsItems[]; extern HMODULE g_hDLLXStatusIcons;
extern HICON g_hMainIcon;
-extern bool g_bChatExist, g_bShutdown;
+extern bool g_bChatExist;
extern size_t g_dwMirWorkDirPathLen;
extern WCHAR g_szMirWorkDirPath[MAX_FILEPATH];
|