From a3870581fb445f370a46b80e432321e2f6a83275 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Mon, 29 Jun 2020 13:01:00 +0300 Subject: [PATCH] spa-device / m-monitor: fix pw_proxy leaks reported by pw_core 1. device export proxies must be destroyed manually since they are not associated with the WpRegistry 2. the monitors should not disconnect before all WpSpaDevice objects are destroyed; remove the manual disconnect call and let GObject ref counting do its job (the core will disconnect when its last ref count is dropped after the last monitor plugin is destroyed) --- lib/wp/device.c | 1 + modules/module-monitor.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wp/device.c b/lib/wp/device.c index c0f544ad..92368106 100644 --- a/lib/wp/device.c +++ b/lib/wp/device.c @@ -270,6 +270,7 @@ wp_spa_device_finalize (GObject * object) { WpSpaDevice *self = WP_SPA_DEVICE (object); + g_clear_pointer (&self->proxy, pw_proxy_destroy); self->device = NULL; g_clear_pointer (&self->handle, pw_unload_spa_handle); g_clear_pointer (&self->properties, wp_properties_unref); diff --git a/modules/module-monitor.c b/modules/module-monitor.c index ca67706f..db5be6b2 100644 --- a/modules/module-monitor.c +++ b/modules/module-monitor.c @@ -393,7 +393,6 @@ wp_monitor_deactivate (WpPlugin * plugin) { WpMonitor *self = WP_MONITOR (plugin); - wp_core_disconnect (self->local_core); g_clear_object (&self->monitor); }