From 36b4657631336dfcba10eaac01390e3031455d6c Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Wed, 6 Mar 2019 15:55:19 +0100 Subject: [PATCH] exit: only wait for completion if a handler was set --- src/common/rclinit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/rclinit.cpp b/src/common/rclinit.cpp index 060360ca..b2e829b4 100644 --- a/src/common/rclinit.cpp +++ b/src/common/rclinit.cpp @@ -184,12 +184,12 @@ LRESULT CALLBACK MainWndProc(HWND hwnd , UINT msg , WPARAM wParam, { if (l_sigcleanup) { l_sigcleanup(SIGINT); + LOGDEB("MainWndProc: got end message, waiting for work finished\n"); + DWORD res = WaitForSingleObject(eWorkFinished, INFINITE); + if (res != WAIT_OBJECT_0) { + LOGERR("MainWndProc: exit ack wait failed\n" ); + } } - LOGDEB("MainWndProc: got end message, waiting for work finished\n" ); - DWORD res = WaitForSingleObject(eWorkFinished, INFINITE); - if (res != WAIT_OBJECT_0) { - LOGERR("MainWndProc: exit ack wait failed\n" ); - } LOGDEB("MainWindowProc: got exit ready event, exiting\n" ); } break;