mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	view: fix crash when a minimized fullscreen window closes
Do not call view methods after invalidating an invariant of the view (view->scene_tree != NULL)
This commit is contained in:
		
							parent
							
								
									e9023f51c6
								
							
						
					
					
						commit
						9d63c803d3
					
				
					 1 changed files with 10 additions and 5 deletions
				
			
		
							
								
								
									
										15
									
								
								src/view.c
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								src/view.c
									
										
									
									
									
								
							| 
						 | 
					@ -2030,11 +2030,6 @@ view_destroy(struct view *view)
 | 
				
			||||||
	osd_on_view_destroy(view);
 | 
						osd_on_view_destroy(view);
 | 
				
			||||||
	undecorate(view);
 | 
						undecorate(view);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (view->scene_tree) {
 | 
					 | 
				
			||||||
		wlr_scene_node_destroy(&view->scene_tree->node);
 | 
					 | 
				
			||||||
		view->scene_tree = NULL;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * The layer-shell top-layer is disabled when an application is running
 | 
						 * The layer-shell top-layer is disabled when an application is running
 | 
				
			||||||
	 * in fullscreen mode, so if that's the case, we may have to re-enable
 | 
						 * in fullscreen mode, so if that's the case, we may have to re-enable
 | 
				
			||||||
| 
						 | 
					@ -2054,6 +2049,16 @@ view_destroy(struct view *view)
 | 
				
			||||||
		menu_close_root(server);
 | 
							menu_close_root(server);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
						 * Destroy the view's scene tree. View methods assume this is non-NULL,
 | 
				
			||||||
 | 
						 * so we should avoid any calls to those between this and freeing the
 | 
				
			||||||
 | 
						 * view.
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						if (view->scene_tree) {
 | 
				
			||||||
 | 
							wlr_scene_node_destroy(&view->scene_tree->node);
 | 
				
			||||||
 | 
							view->scene_tree = NULL;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Remove view from server->views */
 | 
						/* Remove view from server->views */
 | 
				
			||||||
	wl_list_remove(&view->link);
 | 
						wl_list_remove(&view->link);
 | 
				
			||||||
	free(view);
 | 
						free(view);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue