summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/popup_thread.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-20 16:03:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-20 16:03:04 +0000
commitd7b15f5f89319f1a9077efb50bd3a242a5dc2b52 (patch)
treea28c1bfd2a40556cb61f95ec67e1d9aabeb82cd5 /plugins/Popup/src/popup_thread.cpp
parent5c7ba495c74de2d7342ad05c59632b43c1d5321f (diff)
fixes for various hangups & crashes on exit
git-svn-id: http://svn.miranda-ng.org/main/trunk@3652 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup/src/popup_thread.cpp')
-rw-r--r--plugins/Popup/src/popup_thread.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp
index 5a968fb606..5c7ecfb9d0 100644
--- a/plugins/Popup/src/popup_thread.cpp
+++ b/plugins/Popup/src/popup_thread.cpp
@@ -57,8 +57,7 @@ static void __cdecl PopupThread(void *arg);
void LoadPopupThread()
{
hThreadMutex = CreateMutex(NULL, FALSE, NULL);
- _beginthread(PopupThread, 0, NULL);
-// _beginthreadex(NULL, 0, PopupThread, NULL, 0, &idPopupThread);
+ mir_forkthread(PopupThread, NULL);
}
void StopPopupThread()
@@ -299,8 +298,8 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA
static void __cdecl PopupThread(void *arg)
{
// grab the mutex
- if (WaitForSingleObject(hThreadMutex, INFINITE) != WAIT_OBJECT_0)
- { // other thread is already running
+ if ( WaitForSingleObject(hThreadMutex, INFINITE) != WAIT_OBJECT_0) {
+ // other thread is already running
_endthread();
return;
}
@@ -335,19 +334,10 @@ static void __cdecl PopupThread(void *arg)
SetWindowPos(gHwndManager, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_HIDEWINDOW);
MSG msg;
- while (GetMessage(&msg, NULL, 0, 0))
- {
+ while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
ReleaseMutex(hThreadMutex);
-
- // Decrement Miranda thread counter
- Thread_Pop();
-
- // Ok, now we can kill this thread
- _endthread();
-
- return;
}