mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04: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
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue