mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
proxy: _remove keeps the proxy alive when not destroyed
When we get a remove, increment the refcount only when the proxy has not yet been destroyed.
This commit is contained in:
parent
181ca167e7
commit
34da9015b9
1 changed files with 7 additions and 4 deletions
|
|
@ -230,7 +230,7 @@ static inline void remove_from_map(struct pw_proxy *proxy)
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
void pw_proxy_destroy(struct pw_proxy *proxy)
|
void pw_proxy_destroy(struct pw_proxy *proxy)
|
||||||
{
|
{
|
||||||
pw_log_debug(NAME" %p: destroy id:%u removed:%u zombie:%u ref:%u", proxy,
|
pw_log_debug(NAME" %p: destroy id:%u removed:%u zombie:%u ref:%d", proxy,
|
||||||
proxy->id, proxy->removed, proxy->zombie, proxy->refcount);
|
proxy->id, proxy->removed, proxy->zombie, proxy->refcount);
|
||||||
|
|
||||||
assert(!proxy->destroyed);
|
assert(!proxy->destroyed);
|
||||||
|
|
@ -264,10 +264,13 @@ void pw_proxy_remove(struct pw_proxy *proxy)
|
||||||
{
|
{
|
||||||
assert(proxy->refcount > 0);
|
assert(proxy->refcount > 0);
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: remove id:%u removed:%u destroyed:%u zombie:%u", proxy,
|
pw_log_debug(NAME" %p: remove id:%u removed:%u destroyed:%u zombie:%u ref:%d", proxy,
|
||||||
proxy->id, proxy->removed, proxy->destroyed, proxy->zombie);
|
proxy->id, proxy->removed, proxy->destroyed, proxy->zombie,
|
||||||
|
proxy->refcount);
|
||||||
|
|
||||||
|
if (!proxy->destroyed)
|
||||||
|
proxy->refcount++;
|
||||||
|
|
||||||
proxy->refcount++;
|
|
||||||
if (!proxy->removed) {
|
if (!proxy->removed) {
|
||||||
/* mark removed and emit the removed signal only once and
|
/* mark removed and emit the removed signal only once and
|
||||||
* only when not already destroyed */
|
* only when not already destroyed */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue