diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-01 20:13:38 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-01 20:13:38 +0000 |
commit | bea9db47cd38198c8fb0ba276f5dba3004c5e2fa (patch) | |
tree | 1cc8638397d70ad48a2760b957a9a32156d25679 | |
parent | 228b90fa921f6b9aedb920cd097c5b725f0ad5de (diff) |
fixes issue #523: using CallFunctionAsync() at AutoShutdown
git-svn-id: http://svn.miranda-ng.org/main/trunk@7450 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/AutoShutdown/src/watcher.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 71ea713e9a..a48161c85b 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -48,16 +48,18 @@ static void __stdcall MainThreadMapping(void *param) HANDLE *phDoneEvent = (HANDLE*)param;
ServiceShutdown(0,TRUE); /* ensure main thread (for cpu usage shutdown) */
ServiceStopWatcher(0,0);
- if (*phDoneEvent != NULL) SetEvent(*phDoneEvent);
+ if (*phDoneEvent != NULL)
+ SetEvent(*phDoneEvent);
}
static void __inline ShutdownAndStopWatcher(void)
{
- HANDLE hDoneEvent;
- hDoneEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
- if (CallFunctionAsync(MainThreadMapping, &hDoneEvent))
- if (hDoneEvent != NULL) WaitForSingleObject(hDoneEvent,INFINITE);
- if (hDoneEvent != NULL) CloseHandle(hDoneEvent);
+ HANDLE hDoneEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ CallFunctionAsync(MainThreadMapping, &hDoneEvent);
+ if (hDoneEvent != NULL) {
+ WaitForSingleObject(hDoneEvent,INFINITE);
+ CloseHandle(hDoneEvent);
+ }
}
/************************* Msg Shutdown *******************************/
|