mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-04 23:38:01 +02:00
core: remove_global: remove object from the list before triggering the notification
This avoids being able to find the same object on the globals list from code that is connected to the signal.
This commit is contained in:
parent
ca1453febd
commit
b770cf6a3e
1 changed files with 8 additions and 5 deletions
|
|
@ -193,6 +193,7 @@ wp_core_remove_global (WpCore * self, GQuark key, gpointer obj)
|
|||
{
|
||||
gint i;
|
||||
struct global_object *global;
|
||||
struct global_object tmp;
|
||||
|
||||
g_return_if_fail (WP_IS_CORE (self));
|
||||
|
||||
|
|
@ -206,13 +207,15 @@ wp_core_remove_global (WpCore * self, GQuark key, gpointer obj)
|
|||
}
|
||||
|
||||
if (i < self->global_objects->len) {
|
||||
g_signal_emit (self, signals[SIGNAL_GLOBAL_REMOVED], key,
|
||||
key, global->object);
|
||||
|
||||
if (global->destroy)
|
||||
global->destroy (global->object);
|
||||
tmp = *global;
|
||||
|
||||
g_ptr_array_remove_index_fast (self->global_objects, i);
|
||||
|
||||
g_signal_emit (self, signals[SIGNAL_GLOBAL_REMOVED], key,
|
||||
key, tmp.object);
|
||||
|
||||
if (tmp.destroy)
|
||||
tmp.destroy (tmp.object);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue