From aab0c7669d748c371a575e1fa634ec5f72c7e5dd Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Tue, 26 Mar 2013 18:07:52 +0100 Subject: [PATCH] Fixed issue #1566: Frequent crashes when searching log Guard access to git_open_log so that it does not infer with the async diff thread. Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/GitLogListBase.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Changelog.txt b/src/Changelog.txt index 3eb517982..20898bb5e 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -61,6 +61,7 @@ Released: unreleased * Fixed issue #1223: Workaround endless waiting when git.exe already exited * Fixed issue #1709: Right click -> assume unchanged is irreversible * Fixed issue #1713: Pre-populate commit message on squash merges + * Fixed issue #1566: Frequent crashes when searching log = Release 1.8.1.0 = Released: 2013-02-07 diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index 07a32713f..f4498fa38 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -2405,18 +2405,22 @@ int CGitLogListBase::BeginFetchLog() cmd = g_Git.GetLogCmd(list[0], path, -1, mask, true, &data); } + g_Git.m_critGitDllSec.Lock(); try { if (git_open_log(&m_DllGitLog, CUnicodeUtils::GetMulti(cmd, CP_UTF8).GetBuffer())) { + g_Git.m_critGitDllSec.Unlock(); return -1; } } catch (char* msg) { + g_Git.m_critGitDllSec.Unlock(); CString err(msg); MessageBox(_T("Could not open log.\nlibgit reports:\n") + err, _T("TortoiseGit"), MB_ICONERROR); return -1; } + g_Git.m_critGitDllSec.Unlock(); return 0; } -- 2.11.4.GIT