Crash when closing project options
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
- Open IDE
- Open Project Options
- Hit Escape to cancel
gives an access violation.
It depends on accessing a free'd object. So it may not always be reproducible.
It should happen with -gh / Maybe needs env HEAPTRC="keepreleased"
ide\ideoptionsdlg.pas line385
procedure TIDEOptionsDialog.WriteAll(Restore: boolean);
In the last stage (sfAfter)
Instance := Rec^.GroupClass.GetInstance;
will get the CompilerOptions
Instance.DoAfterWrite(Restore);
calls
procedure TAbstractIDEOptions.DoAfterWrite(Restore: boolean);
FOnAfterWrite(Self,Restore);
calls
procedure TProjectCompilerOptions.AfterWriteExec(Sender:TObject;Restore:boolean);
begin
if Restore and (LazProject<>nil) then
LazProject.RestoreBuildModes;
end;
and RestoreBuildModes frees the instance of CompileOptions.
The calling code still uses that instance....
Mantis conversion info:
- Mantis ID: 36910
- OS: win 10
- OS Build: 10
- Platform: 64bit Intel
- Version: 2.1 (SVN)
- Fixed in revision: r63543 (#e266c8d1)