diff --git a/source/main.pas b/source/main.pas index cf45e173..67259e43 100644 --- a/source/main.pas +++ b/source/main.pas @@ -3052,7 +3052,7 @@ procedure TMainForm.LogSQL(Msg: WideString; Category: TMySQLLogCategory=lcInfo); var snip, IsSQL: Boolean; begin - if Category = lcDebug then + if (Category = lcDebug) or (csDestroying in ComponentState) then Exit; // Shorten very long messages snip := (prefLogSqlWidth > 0) and (Length(Msg) > prefLogSqlWidth);