diff --git a/lib/wp/core.c b/lib/wp/core.c index 34984c2b112269cc4cc3de21ebcd07bf7f2a37f8..5d9c24f47dec9357d02e3c601b3e9ee61605727a 100644 --- a/lib/wp/core.c +++ b/lib/wp/core.c @@ -60,7 +60,8 @@ wp_core_dispose (GObject * obj) /* Remove and emit the removed signal for all globals */ while (global_objects->len > 0) { - global = g_ptr_array_steal_index_fast (global_objects, 0); + global = g_ptr_array_steal_index_fast (global_objects, + global_objects->len - 1); g_signal_emit (self, signals[SIGNAL_GLOBAL_REMOVED], global->key, global->key, global->object); free_global_object (global); diff --git a/lib/wp/proxy.c b/lib/wp/proxy.c index 8d9917b47d4fe44fe8b912f24cc8a516c65cffbf..54622d135da47aa0772de09f0fb6d5c6ab169878 100644 --- a/lib/wp/proxy.c +++ b/lib/wp/proxy.c @@ -34,7 +34,6 @@ enum { enum { - SIGNAL_DESTROYED, SIGNAL_DONE, LAST_SIGNAL, }; @@ -54,9 +53,6 @@ proxy_event_destroy (void *data) /* Set the proxy to NULL */ self->proxy = NULL; - - /* Emit the destroy signal */ - g_signal_emit (data, wp_proxy_signals[SIGNAL_DESTROYED], 0); } static void @@ -198,10 +194,6 @@ wp_proxy_class_init (WpProxyClass * klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); /* Signals */ - wp_proxy_signals[SIGNAL_DESTROYED] = - g_signal_new ("destroyed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (WpProxyClass, destroyed), NULL, NULL, NULL, G_TYPE_NONE, - 0); wp_proxy_signals[SIGNAL_DONE] = g_signal_new ("done", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (WpProxyClass, done), NULL, NULL, NULL, G_TYPE_NONE, 0); diff --git a/lib/wp/proxy.h b/lib/wp/proxy.h index be3570b4b33a12b54d5e0fbed078543aac414373..5dab6a80ef9a6823e32e1cb70aa26ed8195f88d6 100644 --- a/lib/wp/proxy.h +++ b/lib/wp/proxy.h @@ -24,7 +24,6 @@ struct _WpProxyClass GObjectClass parent_class; /* Signals */ - void (*destroyed)(WpProxy *wp_proxy, gpointer data); void (*done)(WpProxy *wp_proxy, gpointer data); }; diff --git a/modules/module-pipewire.c b/modules/module-pipewire.c index 7a58def4ee06cdf7fee4029a0e190e126b96ee58..9394b1e6e30b27fbb4287b252ae21857ca4e867a 100644 --- a/modules/module-pipewire.c +++ b/modules/module-pipewire.c @@ -105,9 +105,9 @@ on_global_removed (WpRemotePipewire *rp, guint id, gpointer d) if (!endpoint) return; - /* Remove the endpoint from the table and unregister it */ - g_hash_table_remove (data->registered_endpoints, GUINT_TO_POINTER(id)); + /* Unregister the endpoint and remove it from the table */ wp_endpoint_unregister (endpoint); + g_hash_table_remove (data->registered_endpoints, GUINT_TO_POINTER(id)); } static void diff --git a/modules/module-pw-alsa-udev.c b/modules/module-pw-alsa-udev.c index dd652f3e94744f7c164c0983039acfd51b897e62..74c34979e6e326224e771735aab63926fec4d60d 100644 --- a/modules/module-pw-alsa-udev.c +++ b/modules/module-pw-alsa-udev.c @@ -92,9 +92,9 @@ on_global_removed (WpRemotePipewire *rp, guint id, gpointer d) if (!endpoint) return; - /* Remove the endpoint from the table and unregister it */ - g_hash_table_remove (impl->registered_endpoints, GUINT_TO_POINTER(id)); + /* Unregister the endpoint and remove it from the table */ wp_endpoint_unregister (endpoint); + g_hash_table_remove (impl->registered_endpoints, GUINT_TO_POINTER(id)); } static void