proxy: add refcount to keep the proxy alive in demarshal

We need to keep the proxy alive during demarshal because the callbacks
might decide to destroy the proxy.
This commit is contained in:
Wim Taymans 2019-08-16 15:19:19 +02:00
parent 58fd46ebd1
commit 84ec90da2d
3 changed files with 21 additions and 4 deletions

View file

@ -654,6 +654,7 @@ struct pw_proxy {
struct pw_remote *remote; /**< the owner remote of this proxy */
uint32_t id; /**< client side id */
int refcount;
unsigned int zombie:1; /**< proxy is removed locally and waiting to
* be removed from server */
unsigned int removed:1; /**< proxy was removed from server */
@ -910,6 +911,8 @@ int pw_control_remove_link(struct pw_control_link *link);
void pw_control_destroy(struct pw_control *control);
void pw_proxy_unref(struct pw_proxy *proxy);
/** \endcond */
#ifdef __cplusplus