From 105bc4f759b12a8bdd7d1cafa6fce41f906acbe1 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 13 Jan 2011 00:53:24 +0000 Subject: [PATCH] DBG: prevent 2 double-clicks on stack entry, from opening the same file twice git-svn-id: trunk@28982 - --- debugger/callstackdlg.pp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/debugger/callstackdlg.pp b/debugger/callstackdlg.pp index 8ed22ce3a5..09b1105775 100644 --- a/debugger/callstackdlg.pp +++ b/debugger/callstackdlg.pp @@ -360,16 +360,22 @@ begin Entry := GetCurrentEntry; if Entry = nil then Exit; - // check the full name first - Filename := Entry.FullFileName; - if (Filename = '') or not DebugBoss.GetFullFilename(Filename, False) then - begin - // if fails the check the short file name - Filename := Entry.Source; - if (FileName = '') or not DebugBoss.GetFullFilename(Filename, True) then - Exit; + // avoid any process-messages, so this proc can not be re-entered (avoid opening one files many times) + DebugBoss.LockCommandProcessing; + try + // check the full name first + Filename := Entry.FullFileName; + if (Filename = '') or not DebugBoss.GetFullFilename(Filename, False) then + begin + // if fails the check the short file name + Filename := Entry.Source; + if (FileName = '') or not DebugBoss.GetFullFilename(Filename, True) then + Exit; + end; + MainIDE.DoJumpToSourcePosition(Filename, 0, Entry.Line, 0, True, True); + finally + DebugBoss.UnLockCommandProcessing; end; - MainIDE.DoJumpToSourcePosition(Filename, 0, Entry.Line, 0, True, True); end; procedure TCallStackDlg.CopyToClipBoard;