mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	wayland-client : Fix queue_release not to call proxy_destroy
proxy_destroy could be called twice by wl_proxy_destroy and wl_event_queue_release. Then, wl_map_remove was called twice for same object id. Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
		
							parent
							
								
									bbe6795d9b
								
							
						
					
					
						commit
						441f9bb144
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
					@ -259,6 +259,7 @@ wl_event_queue_release(struct wl_event_queue *queue)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct wl_closure *closure;
 | 
						struct wl_closure *closure;
 | 
				
			||||||
	struct wl_proxy *proxy;
 | 
						struct wl_proxy *proxy;
 | 
				
			||||||
 | 
						bool proxy_destroyed;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (!wl_list_empty(&queue->event_list)) {
 | 
						while (!wl_list_empty(&queue->event_list)) {
 | 
				
			||||||
		closure = container_of(queue->event_list.next,
 | 
							closure = container_of(queue->event_list.next,
 | 
				
			||||||
| 
						 | 
					@ -268,10 +269,11 @@ wl_event_queue_release(struct wl_event_queue *queue)
 | 
				
			||||||
		decrease_closure_args_refcount(closure);
 | 
							decrease_closure_args_refcount(closure);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		proxy = closure->proxy;
 | 
							proxy = closure->proxy;
 | 
				
			||||||
		if (proxy->refcount == 1)
 | 
							proxy_destroyed = !!(proxy->flags & WL_PROXY_FLAG_DESTROYED);
 | 
				
			||||||
			proxy_destroy(proxy);
 | 
					
 | 
				
			||||||
		else
 | 
							proxy->refcount--;
 | 
				
			||||||
			--proxy->refcount;
 | 
							if (proxy_destroyed && !proxy->refcount)
 | 
				
			||||||
 | 
								free(proxy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		wl_closure_destroy(closure);
 | 
							wl_closure_destroy(closure);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue