[MacOS] FMX ScreenReader can crash the application! (berichtet am 11.02.2015)
In FMX.ScreenReader.MAC.pas the is a global variable "FocusedCtrl".
If a second form is shown & freed, the variable FocusedCtrl can point to a control which has already been freed.
In various places the variable is accessed and can be a dangling pointer -> BUUUM
Workaround in FMX.ScreenReader.MAC.pas:
Code:
destructor TAccForm.Destroy;
var
MyControl: TFmxObject;
begin
FEditTimer.Free;
FEditMouseUp.Free;
// Make sure freed form has no longer reference to control
MyControl:= FocusedCtrl;
while Assigned(MyControl) do
begin
if (MyControl is TForm) and ((MyControl as TForm) = Self) then
begin
FocusedCtrl:= nil;
Break;
end;
MyControl:= MyControl.Parent;
end;
inherited;
end;