mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-14 20:02:38 +00:00
fdmanager: decrement object refcount correctly
The object needs to be decremented each time a client releases it.
This commit is contained in:
parent
a25bdf8acb
commit
833168c3cf
|
@ -64,7 +64,6 @@ static void
|
|||
object_id_free (ObjectId *oid)
|
||||
{
|
||||
g_assert (oid->refcount == 0);
|
||||
oid->notify (oid->obj);
|
||||
g_slice_free (ObjectId, oid);
|
||||
}
|
||||
|
||||
|
@ -236,6 +235,8 @@ pinos_fd_manager_remove (PinosFdManager *manager,
|
|||
|
||||
if (find) {
|
||||
cids->ids = g_list_delete_link (cids->ids, find);
|
||||
|
||||
oid->notify (oid->obj);
|
||||
oid->refcount--;
|
||||
if (oid->refcount == 0) {
|
||||
g_hash_table_remove (priv->object_ids, GINT_TO_POINTER (id));
|
||||
|
@ -253,6 +254,7 @@ remove_id (ObjectId *oid, PinosFdManager *manager)
|
|||
{
|
||||
PinosFdManagerPrivate *priv = manager->priv;
|
||||
|
||||
oid->notify (oid->obj);
|
||||
oid->refcount--;
|
||||
if (oid->refcount == 0) {
|
||||
g_hash_table_remove (priv->object_ids, GINT_TO_POINTER (oid->id));
|
||||
|
|
Loading…
Reference in a new issue