From eb86752ad78b9dbbe81ed957c4e6924f1a43df2b Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Wed, 3 Apr 2013 20:38:28 +0800 Subject: [PATCH] Fix Log Dialog sometimes blocks on closing, TortoiseGitProc.exe not exiting Call PeekMessage() to check the message loop before calling AfxGetThread()->PumpMessage() Signed-off-by: Sup Yut Sum --- src/TortoiseProc/GitLogListBase.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TortoiseProc/GitLogListBase.h b/src/TortoiseProc/GitLogListBase.h index 434e86ecb..764da39fe 100644 --- a/src/TortoiseProc/GitLogListBase.h +++ b/src/TortoiseProc/GitLogListBase.h @@ -494,7 +494,9 @@ public: // do not block here, but process messages and ask until the thread ends while (ret == WAIT_TIMEOUT && !m_AsyncThreadExited) { - AfxGetThread()->PumpMessage(); // process messages, so that GetTopIndex and so on in the thread work + MSG msg; + if (::PeekMessage(&msg, NULL, 0,0, PM_NOREMOVE)) + AfxGetThread()->PumpMessage(); // process messages, so that GetTopIndex and so on in the thread work ret = ::WaitForSingleObject(m_DiffingThread->m_hThread, 100); } m_DiffingThread = NULL; -- 2.11.4.GIT