From b3c676d75215f6efc97b2bb867f9b019b3c3d05e Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 19 Jan 2019 10:27:02 +0100 Subject: [PATCH] Silence rare crash when calculating current query duration. Closes #490. --- source/main.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/main.pas b/source/main.pas index f9130f41..2da60312 100644 --- a/source/main.pas +++ b/source/main.pas @@ -12773,13 +12773,14 @@ begin Msg := _('query')+' #' + FormatNumber(ExecutionThread.BatchPosition+1); if ExecutionThread.QueriesInPacket > 1 then Msg := f_('queries #%s to #%s', [FormatNumber(ExecutionThread.BatchPosition+1), FormatNumber(ExecutionThread.BatchPosition+ExecutionThread.QueriesInPacket)]); - Elapsed := MilliSecondsBetween(ExecutionThread.QueryStartedAt, Now); - ElapsedMsg := FormatTimeNumber(Elapsed/1000, True); try + Elapsed := MilliSecondsBetween(ExecutionThread.QueryStartedAt, Now); + ElapsedMsg := FormatTimeNumber(Elapsed/1000, True); MainForm.ShowStatusMsg(ElapsedMsg + ': ' + f_('Executing %s of %s ...', [Msg, FormatNumber(ExecutionThread.Batch.Count)])); except; // Some crashes here, probably when accessing the no longer running thread. // See https://www.heidisql.com/forum.php?t=25418#p25484 + // See issue https://github.com/HeidiSQL/HeidiSQL/issues/490 end; end;