summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_gettextasync.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-22 14:26:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-22 14:26:10 +0000
commit29f62500c6b297dae647c75d62fdb0b9f9c7de85 (patch)
tree207b8c1f02ee61ce37c10e6abe81ef7d9e9689e4 /plugins/Clist_modern/src/modern_gettextasync.cpp
parenta75aaad7e9bf48d1456ac01a93997398b6719730 (diff)
more correct way of leaving thread
git-svn-id: http://svn.miranda-ng.org/main/trunk@11580 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_gettextasync.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_gettextasync.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/Clist_modern/src/modern_gettextasync.cpp b/plugins/Clist_modern/src/modern_gettextasync.cpp
index 23e6a7f9dd..82f90e95fa 100644
--- a/plugins/Clist_modern/src/modern_gettextasync.cpp
+++ b/plugins/Clist_modern/src/modern_gettextasync.cpp
@@ -69,6 +69,8 @@ static BOOL gtaGetItem(GTACHAINITEM *mpChain)
static void gtaThreadProc(void*)
{
+ Netlib_Logf(NULL, "GTA thread start");
+
thread_catcher lck(g_hGetTextAsyncThread);
SHORTDATA data = { 0 };
@@ -76,7 +78,7 @@ static void gtaThreadProc(void*)
Sync(CLUI_SyncGetShortData, (WPARAM)pcli->hwndContactTree, (LPARAM)&data);
while (true) {
if (MirandaExiting())
- return;
+ goto LBL_Exit;
SleepEx(0, TRUE); //1000 contacts per second
@@ -93,7 +95,7 @@ static void gtaThreadProc(void*)
dat = &dat2;
}
if (MirandaExiting())
- return;
+ goto LBL_Exit;
ClcCacheEntry cacheEntry;
memset(&cacheEntry, 0, sizeof(cacheEntry));
@@ -112,9 +114,11 @@ static void gtaThreadProc(void*)
WaitForSingleObjectEx(hgtaWakeupEvent, INFINITE, TRUE);
ResetEvent(hgtaWakeupEvent);
}
-
+
+LBL_Exit:
CloseHandle(hgtaWakeupEvent);
hgtaWakeupEvent = NULL;
+ Netlib_Logf(NULL, "GTA thread end");
}
BOOL gtaWakeThread()