From e7c269e01491b42734eb4ea2fdb9e46a941616c9 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Sat, 12 Aug 2023 17:30:24 +0200 Subject: [PATCH] shell/camera-monitor: Remove hooks before destroying objects Otherwise removing the hook will try to unlink from a list whose previous element belonged to the already destroyed object. Fixes: d09d24666 ("shell: Add device monitor for cameras") Part-of: --- src/shell-camera-monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell-camera-monitor.c b/src/shell-camera-monitor.c index 1b98b7dc8..1e2e0f145 100644 --- a/src/shell-camera-monitor.c +++ b/src/shell-camera-monitor.c @@ -297,10 +297,10 @@ shell_camera_monitor_disconnect_core (ShellCameraMonitor *monitor) g_ptr_array_set_size (monitor->node_list, 0); g_clear_handle_id (&monitor->delayed_disable_id, g_source_remove); - g_clear_pointer ((struct pw_proxy**) &monitor->registry, pw_proxy_destroy); spa_hook_remove (&monitor->registry_listener); - g_clear_pointer (&monitor->core, pw_core_disconnect); + g_clear_pointer ((struct pw_proxy**) &monitor->registry, pw_proxy_destroy); spa_hook_remove (&monitor->core_listener); + g_clear_pointer (&monitor->core, pw_core_disconnect); } static gboolean