From f4041687392c031ff932201d5cf026fa8c828915 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 30 Aug 2023 18:23:07 +0200 Subject: [PATCH] jack: mark object registered when emit is suppressed When we don't manage to emit the notify, still mark the object as registered. Otherwise we might not emit the unregistered notify later on. This usually happens when a client connects and the notifies are suppressed for all the objects in the graph. When they later disappear we do want to emit the unregistered notify. --- pipewire-jack/src/pipewire-jack.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 431ecfef9..dec428b30 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -1108,9 +1108,12 @@ static int queue_notify(struct client *c, int type, struct object *o, int arg1, } pw_log_debug("%p: skip notify %08x active:%d emit:%d", c, type, c->active, emit); - if (o != NULL && arg1 == 0 && o->removing) { - o->removing = false; - free_object(c, o); + if (o != NULL) { + o->registered = arg1; + if (arg1 == 0 && o->removing) { + o->removing = false; + free_object(c, o); + } } return res; }