From 659fc81d447e94902ca9346710a187e5e5e7ad24 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Thu, 7 Apr 2011 23:12:48 +0200 Subject: [PATCH] TortoiseProc.exe sometimes didn't exit correctly after closing the log dialog for some reason sometimes m_DiffingThread-thread exists, but m_DiffingThread->m_hThread stays active forever, this HACK fixes this Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/GitLogListBase.h | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 7161ab5ba..c5a510568 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -43,6 +43,7 @@ * Rebase failed at revision with empty commit message. * Fixed sorting of columns of file lists (e.g. commit dialog). * Fixed issue #757: TortoiseGit Blame not working from working dir. + * TortoiseProc.exe sometimes didn't exit correctly after closing the log dialog * TortoiseGitCache Partly rewritten to fix various issues. diff --git a/src/TortoiseProc/GitLogListBase.h b/src/TortoiseProc/GitLogListBase.h index 0d2002c33..1d0bb9cd0 100644 --- a/src/TortoiseProc/GitLogListBase.h +++ b/src/TortoiseProc/GitLogListBase.h @@ -424,6 +424,8 @@ protected: } int AsyncDiffThread(); + bool m_AsyncThreadExited; + public: void SafeTerminateAsyncDiffThread() { @@ -433,7 +435,7 @@ public: ::SetEvent(m_AsyncDiffEvent); DWORD ret = WAIT_TIMEOUT; // do not block here, but process messages and ask until the thread ends - while (ret == WAIT_TIMEOUT) + while (ret == WAIT_TIMEOUT && !m_AsyncThreadExited) { AfxGetThread()->PumpMessage(); // process messages, so that GetTopIndex and so on in the thread work ret = ::WaitForSingleObject(m_DiffingThread->m_hThread, 100); @@ -443,7 +445,7 @@ public: }; protected: - CComCriticalSection m_critSec; + CComCriticalSection m_critSec; CXPTheme m_Theme; BOOL m_bVista; -- 2.11.4.GIT