[gnome-remote-desktop] session-vnc: Don't leak the socket source



commit 19f140ad5cddbe45447b8c69300cb8e4f12c4bfc
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Sun Apr 24 12:19:51 2022 +0200

    session-vnc: Don't leak the socket source

 src/grd-session-vnc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c
index a4cb9589..fbc66a41 100644
--- a/src/grd-session-vnc.c
+++ b/src/grd-session-vnc.c
@@ -654,7 +654,11 @@ grd_session_vnc_attach_source (GrdSessionVnc *session_vnc)
 static void
 grd_session_vnc_detach_source (GrdSessionVnc *session_vnc)
 {
-  g_clear_pointer (&session_vnc->source, g_source_destroy);
+  if (!session_vnc->source)
+    return;
+
+  g_source_destroy (session_vnc->source);
+  g_clear_pointer (&session_vnc->source, g_source_unref);
 }
 
 GrdSessionVnc *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]