mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 03:08:13 +02:00
object-manager: keep a reference to self while doing a core sync
Otherwise, if the object manager is destroyed while a sync is in progress, we get an invalid 'self' pointer on the callback later, which is being called regardless There is a bit more work that should be done in the core to avoid leaking this ref in case pipewire disconnects before the sync is completed
This commit is contained in:
parent
d5c3f7ee87
commit
92107e8342
1 changed files with 2 additions and 2 deletions
|
|
@ -362,7 +362,7 @@ wp_object_manager_is_interested_in_global (WpObjectManager * self,
|
|||
static void
|
||||
sync_emit_objects_changed (WpCore *core, GAsyncResult *res, gpointer data)
|
||||
{
|
||||
WpObjectManager *self = data;
|
||||
g_autoptr (WpObjectManager) self = WP_OBJECT_MANAGER (data);
|
||||
|
||||
g_signal_emit (self, signals[SIGNAL_OBJECTS_CHANGED], 0);
|
||||
self->pending_objchanged = FALSE;
|
||||
|
|
@ -377,7 +377,7 @@ schedule_emit_objects_changed (WpObjectManager * self)
|
|||
g_autoptr (WpCore) core = g_weak_ref_get (&self->core);
|
||||
if (core) {
|
||||
wp_core_sync (core, NULL, (GAsyncReadyCallback)sync_emit_objects_changed,
|
||||
self);
|
||||
g_object_ref (self));
|
||||
self->pending_objchanged = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue