From 29f62500c6b297dae647c75d62fdb0b9f9c7de85 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Dec 2014 14:26:10 +0000 Subject: more correct way of leaving thread git-svn-id: http://svn.miranda-ng.org/main/trunk@11580 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_modern/src/modern_gettextasync.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/Clist_modern') 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() -- cgit v1.2.3