client: Use refcount exclusively for destruction
authorDaniel Stone <daniels@collabora.com>
Thu, 28 Dec 2017 15:41:18 +0000 (15:41 +0000)
committerDaniel Stone <daniels@collabora.com>
Tue, 9 Jan 2018 15:17:58 +0000 (15:17 +0000)
commitb39d8933973394432bf994b0c6e564fdaceb4757
treea17836cf77829da6fcf9cd7fff6dcffa947fb1bd
parentc380adc554a3d0e2a567ff07deab020a3068304c
client: Use refcount exclusively for destruction

Commit e273c7cde added a refcount to wl_proxy. The refcount is set to 1
on creation, decreased when the client explicitly destroys the proxy,
and is increased and decreased every time an event referencing that
proxy is queued.

Assuming no bugs, this means the refcount cannot reach 0 without the
proxy being explicitly destroyed. However, some (not all) of the
proxy-unref paths were only destroying the proxy if it had already been
deleted. This should already be enforced by refcounting, so remove the
check and rely solely on the refcount as the arbiter of when to free a
proxy.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Cc: Jonas Ã…dahl <jadahl@gmail.com>
src/wayland-client.c