[PATCH wayland] wayland-client : Fix duplicated proxy destroy
Elvis Lee
kwangwoong.lee at lge.com
Fri Jul 31 00:04:14 PDT 2015
proxy_destroy can be called twice by wl_proxy_destroy and wl_event_queue_release.
In that case, wl_map_remove should be called only once for same object id.
Signed-off-by: Elvis Lee <kwangwoong.lee at lge.com>
---
src/wayland-client.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/wayland-client.c b/src/wayland-client.c
index 6450b67..b087ed3 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -405,6 +405,9 @@ wl_proxy_create_for_id(struct wl_proxy *factory,
void
proxy_destroy(struct wl_proxy *proxy)
{
+ if (proxy->flags & WL_PROXY_FLAG_DESTROYED)
+ goto unreference;
+
if (proxy->flags & WL_PROXY_FLAG_ID_DELETED)
wl_map_remove(&proxy->display->objects, proxy->object.id);
else if (proxy->object.id < WL_SERVER_ID_START)
@@ -417,6 +420,7 @@ proxy_destroy(struct wl_proxy *proxy)
proxy->flags |= WL_PROXY_FLAG_DESTROYED;
+unreference:
proxy->refcount--;
if (!proxy->refcount)
free(proxy);
--
1.7.9.5
More information about the wayland-devel
mailing list