From 5d93cf338b43e725ef11ebb52ef06f034887498d Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Tue, 18 Jun 2019 19:42:19 +0300
Subject: [PATCH] remote-endpoint: disconnect the control-value change callback
 when the proxy is destroyed

This avoids the theoretical crash that would happen if you change
the control value on an endpoint whose client-endpoint proxy has
already been destroyed
---
 modules/module-pipewire/remote-endpoint.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/module-pipewire/remote-endpoint.c b/modules/module-pipewire/remote-endpoint.c
index 76ed76c1..29c6f539 100644
--- a/modules/module-pipewire/remote-endpoint.c
+++ b/modules/module-pipewire/remote-endpoint.c
@@ -385,6 +385,8 @@ client_endpoint_proxy_destroy (void *object)
 {
   WpEndpoint *ep = object;
   g_object_set_qdata (G_OBJECT (ep), remote_endpoint_data_quark (), NULL);
+  g_signal_handlers_disconnect_matched (ep, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
+      on_endpoint_notify_control_value, NULL);
 }
 
 static const struct pw_proxy_events proxy_events = {
-- 
GitLab