mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 16:31:36 +01: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); | ||||
| var W: PWindow; | ||||
|     KeePOwner : PGroup; | ||||
| begin | ||||
|   case Event.What of | ||||
|     evKeyDown : | ||||
| @ -203,7 +204,22 @@ begin | ||||
|         cmDeleteItem : | ||||
|           if C^.Count>0 then | ||||
|           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; | ||||
|             ClearEvent(Event); | ||||
|           end; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 pierre
						pierre