mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-16 07:00:00 -05:00
proxy: remove hooks in _destroy
Callers of _destroy should be able to reply on the fact that no more events will be emited on the proxy whitout being required to remove the hooks themselves. Because of the refcount in the proxy, it can stay alive after the _destroy and being used to emit events, like emit an error in protocol-native. Fixes #366
This commit is contained in:
parent
a362889712
commit
3fe31862ef
1 changed files with 6 additions and 0 deletions
|
|
@ -231,6 +231,8 @@ static inline void remove_from_map(struct pw_proxy *proxy)
|
|||
SPA_EXPORT
|
||||
void pw_proxy_destroy(struct pw_proxy *proxy)
|
||||
{
|
||||
struct spa_hook *h;
|
||||
|
||||
pw_log_debug(NAME" %p: destroy id:%u removed:%u zombie:%u ref:%d", proxy,
|
||||
proxy->id, proxy->removed, proxy->zombie, proxy->refcount);
|
||||
|
||||
|
|
@ -256,6 +258,10 @@ void pw_proxy_destroy(struct pw_proxy *proxy)
|
|||
proxy->zombie = true;
|
||||
pw_proxy_emit_destroy(proxy);
|
||||
}
|
||||
|
||||
spa_list_consume(h, &proxy->listener_list.list, link)
|
||||
spa_hook_remove(h);
|
||||
|
||||
pw_proxy_unref(proxy);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue