mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	server: do not send delete_id to a dead client
During client tear-down, all objects are destroyed in id order. Therefore the display object is destroyed first. If the destroy listeners of any object destroy another object by calling wl_resoruce_destroy(), we try to send a delete_id event to the client. This leads to a segmentation fault without a display object. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
		
							parent
							
								
									42eed3235a
								
							
						
					
					
						commit
						cf89b40c4c
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -348,9 +348,11 @@ wl_resource_destroy(struct wl_resource *resource, uint32_t time)
 | 
			
		|||
	struct wl_client *client = resource->client;
 | 
			
		||||
 | 
			
		||||
	if (resource->object.id < WL_SERVER_ID_START) {
 | 
			
		||||
		wl_resource_queue_event(resource->client->display_resource,
 | 
			
		||||
		if (client->display_resource) {
 | 
			
		||||
			wl_resource_queue_event(client->display_resource,
 | 
			
		||||
						WL_DISPLAY_DELETE_ID,
 | 
			
		||||
						resource->object.id);
 | 
			
		||||
		}
 | 
			
		||||
		wl_map_insert_at(&client->objects, resource->object.id, NULL);
 | 
			
		||||
	} else {
 | 
			
		||||
		wl_map_remove(&client->objects, resource->object.id);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue