mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Fix more potential theme related EAccessViolation's, due to Action:=caFree in OnClose event of modal forms. Their caller now frees these modal forms. In non-modal forms, keep caFree in OnClose but remove existing OnDestroy events, moving code to OnClose instead.
https://www.heidisql.com/forum.php?t=38043 https://stackoverflow.com/questions/2075405/how-to-close-non-modal-form-in-delphi
This commit is contained in:
@ -88,7 +88,6 @@ type
|
||||
tabSQL: TTabSheet;
|
||||
memoFindText: TMemo;
|
||||
SynMemoFindText: TSynMemo;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure btnHelpMaintenanceClick(Sender: TObject);
|
||||
@ -309,15 +308,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTableTools.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// Save GUI setup
|
||||
AppSettings.WriteInt(asTableToolsWindowWidth, Width);
|
||||
AppSettings.WriteInt(asTableToolsWindowHeight, Height);
|
||||
AppSettings.WriteInt(asTableToolsTreeWidth, TreeObjects.Width);
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmTableTools.FormShow(Sender: TObject);
|
||||
var
|
||||
Node, FirstChecked: PVirtualNode;
|
||||
@ -392,7 +382,10 @@ begin
|
||||
// Auto close temorary connection
|
||||
if Assigned(FTargetConnection) then
|
||||
FreeAndNil(FTargetConnection);
|
||||
Action := caFree;
|
||||
// Save GUI setup
|
||||
AppSettings.WriteInt(asTableToolsWindowWidth, Width);
|
||||
AppSettings.WriteInt(asTableToolsWindowHeight, Height);
|
||||
AppSettings.WriteInt(asTableToolsTreeWidth, TreeObjects.Width);
|
||||
end;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user