fix, AV on closequery, sheet was not freed if <> current doc

This commit is contained in:
Basile Burg 2015-03-22 10:38:44 +01:00
parent f8f5825989
commit e36e4c39a0
1 changed files with 6 additions and 4 deletions

View File

@ -177,10 +177,12 @@ procedure TCEEditorWidget.docClosing(aDoc: TCESynMemo);
var
sheet: TWinControl;
begin
if fDoc <> aDoc then exit;
sheet := fDoc.Parent;
fDoc.Parent := nil;
fDoc := nil;
if aDoc = nil then
exit;
sheet := aDoc.Parent;
aDoc.Parent := nil;
if aDoc = fDoc then
fDoc := nil;
if sheet <> nil then sheet.Free;
updateImperative;
end;