RxMDI: fix AV on close not active child window

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3574 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75 2014-09-17 12:40:46 +00:00
parent 95e03fe87e
commit eaf9341498

View File

@ -710,7 +710,11 @@ end;
procedure TRxMDIButton.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
FNavPanel.ChildWindowsShowLast;
if (not Assigned(FNavPanel)) or (not Assigned(FNavPanel.FMainPanel)) then
exit;
if FNavPanel.FMainPanel.FCurrentChildWindow = Sender then
FNavPanel.ChildWindowsShowLast;
FNavPanel.ShowHiddenBtnOnResize;
CloseAction:=caFree;
Owner.RemoveComponent(Self);