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 <[email protected]> --- 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 _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
