mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -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)
|
object_id_free (ObjectId *oid)
|
||||||
{
|
{
|
||||||
g_assert (oid->refcount == 0);
|
g_assert (oid->refcount == 0);
|
||||||
oid->notify (oid->obj);
|
|
||||||
g_slice_free (ObjectId, oid);
|
g_slice_free (ObjectId, oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,6 +235,8 @@ pinos_fd_manager_remove (PinosFdManager *manager,
|
||||||
|
|
||||||
if (find) {
|
if (find) {
|
||||||
cids->ids = g_list_delete_link (cids->ids, find);
|
cids->ids = g_list_delete_link (cids->ids, find);
|
||||||
|
|
||||||
|
oid->notify (oid->obj);
|
||||||
oid->refcount--;
|
oid->refcount--;
|
||||||
if (oid->refcount == 0) {
|
if (oid->refcount == 0) {
|
||||||
g_hash_table_remove (priv->object_ids, GINT_TO_POINTER (id));
|
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;
|
PinosFdManagerPrivate *priv = manager->priv;
|
||||||
|
|
||||||
|
oid->notify (oid->obj);
|
||||||
oid->refcount--;
|
oid->refcount--;
|
||||||
if (oid->refcount == 0) {
|
if (oid->refcount == 0) {
|
||||||
g_hash_table_remove (priv->object_ids, GINT_TO_POINTER (oid->id));
|
g_hash_table_remove (priv->object_ids, GINT_TO_POINTER (oid->id));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue