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:
@ -29,7 +29,6 @@ type
|
||||
MemoExample: TSynMemo;
|
||||
timerSearch: TTimer;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure memosKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure ButtonOnlinehelpClick(Sender: TObject);
|
||||
@ -108,7 +107,14 @@ end;
|
||||
|
||||
procedure TfrmSQLhelp.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
AppSettings.WriteInt(asSQLHelpWindowLeft, Left );
|
||||
AppSettings.WriteInt(asSQLHelpWindowTop, Top );
|
||||
AppSettings.WriteInt(asSQLHelpWindowWidth, Width);
|
||||
AppSettings.WriteInt(asSQLHelpWindowHeight, Height);
|
||||
AppSettings.WriteInt(asSQLHelpPnlLeftWidth, pnlLeft.Width);
|
||||
AppSettings.WriteInt(asSQLHelpPnlRightTopHeight, memoDescription.Height);
|
||||
Action := caFree;
|
||||
SqlHelpDialog := nil;
|
||||
end;
|
||||
|
||||
|
||||
@ -264,18 +270,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmSQLhelp.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
AppSettings.WriteInt(asSQLHelpWindowLeft, Left );
|
||||
AppSettings.WriteInt(asSQLHelpWindowTop, Top );
|
||||
AppSettings.WriteInt(asSQLHelpWindowWidth, Width);
|
||||
AppSettings.WriteInt(asSQLHelpWindowHeight, Height);
|
||||
AppSettings.WriteInt(asSQLHelpPnlLeftWidth, pnlLeft.Width);
|
||||
AppSettings.WriteInt(asSQLHelpPnlRightTopHeight, memoDescription.Height);
|
||||
SqlHelpDialog := nil;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmSQLhelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
// Apply themed colors in OnShow, not OnCreate, as a check with <> nil returns false otherwise
|
||||
|
Reference in New Issue
Block a user