fix: stop after removing widget in Widget.remove (fixes ReleaseFast crash)
This commit is contained in:
		
							parent
							
								
									e720d35298
								
							
						
					
					
						commit
						66a1764d6c
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -93,8 +93,10 @@ pub fn addP(self: *Self, w_: Widget) !*Widget {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
pub fn remove(self: *Self, w: Widget) void {
 | 
			
		||||
    for (self.widgets.items, 0..) |p, i| if (p.widget.ptr == w.ptr)
 | 
			
		||||
    for (self.widgets.items, 0..) |p, i| if (p.widget.ptr == w.ptr) {
 | 
			
		||||
        self.widgets.orderedRemove(i).widget.deinit(self.allocator);
 | 
			
		||||
        return;
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub fn remove_all(self: *Self) void {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue