mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	fix cleanup issues in xdg_surface_new
`view->surface` had not been set to a non-`NULL` value here, so it was not yet appropriate to access its `resource` member. instead, use the resource from the argument xdg_surface. furthermore, we need to free the newly-allocated `xdg_toplevel_view` before error return.
This commit is contained in:
		
							parent
							
								
									1ebf5bce90
								
							
						
					
					
						commit
						272221dae2
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -420,7 +420,8 @@ xdg_surface_new(struct wl_listener *listener, void *data)
 | 
			
		|||
		view->scene_tree, xdg_surface);
 | 
			
		||||
	if (!tree) {
 | 
			
		||||
		/* TODO: might need further clean up */
 | 
			
		||||
		wl_resource_post_no_memory(view->surface->resource);
 | 
			
		||||
		wl_resource_post_no_memory(xdg_surface->resource);
 | 
			
		||||
		free(xdg_toplevel_view);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	view->scene_node = &tree->node;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue