mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-22 13:13:25 +02:00
* avoid crash if removing several editor windows
git-svn-id: trunk@7417 -
This commit is contained in:
parent
419d518d4b
commit
ea5bc8c155
@ -182,6 +182,7 @@ end;
|
|||||||
|
|
||||||
procedure TWindowListDialog.HandleEvent(var Event: TEvent);
|
procedure TWindowListDialog.HandleEvent(var Event: TEvent);
|
||||||
var W: PWindow;
|
var W: PWindow;
|
||||||
|
KeePOwner : PGroup;
|
||||||
begin
|
begin
|
||||||
case Event.What of
|
case Event.What of
|
||||||
evKeyDown :
|
evKeyDown :
|
||||||
@ -203,7 +204,22 @@ begin
|
|||||||
cmDeleteItem :
|
cmDeleteItem :
|
||||||
if C^.Count>0 then
|
if C^.Count>0 then
|
||||||
begin
|
begin
|
||||||
Message(C^.At(LB^.Focused),evCommand,cmClose,nil);
|
W:=PWindow(C^.At(LB^.Focused));
|
||||||
|
{ we need to remove the window from the list
|
||||||
|
because otherwise
|
||||||
|
IDEApp.SourceWindowClosed
|
||||||
|
is called after the object has been freed
|
||||||
|
but the ListBox.Redraw will still try to
|
||||||
|
read the title PM }
|
||||||
|
KeepOwner:=W^.Owner;
|
||||||
|
if assigned(KeepOwner) then
|
||||||
|
KeepOwner^.Delete(W);
|
||||||
|
UpdateList;
|
||||||
|
{ But reinsert it as Close might only
|
||||||
|
trigger Hide in some cases }
|
||||||
|
if assigned(KeepOwner) then
|
||||||
|
KeepOwner^.Insert(W);
|
||||||
|
Message(W,evCommand,cmClose,nil);
|
||||||
UpdateList;
|
UpdateList;
|
||||||
ClearEvent(Event);
|
ClearEvent(Event);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user