Blame SOURCES/0023-vdagent-Remove-watch-event-on-vdagent_display_destro.patch

af24d1
From bcbbea34d93d07d33b767f808ff3adf628b1ea0f Mon Sep 17 00:00:00 2001
af24d1
From: Victor Toso <victortoso@redhat.com>
af24d1
Date: Fri, 13 Jan 2023 13:54:06 +0100
af24d1
Subject: [PATCH] vdagent: Remove watch event on vdagent_display_destroy()
af24d1
af24d1
To avoid main loop calling it when GIOChannel for x11 was already
af24d1
destroyed.
af24d1
af24d1
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2145004
af24d1
Signed-off-by: Victor Toso <victortoso@redhat.com>
af24d1
---
af24d1
 src/vdagent/display.c | 6 ++++--
af24d1
 1 file changed, 4 insertions(+), 2 deletions(-)
af24d1
af24d1
diff --git a/src/vdagent/display.c b/src/vdagent/display.c
af24d1
index 790d9ad..602ab65 100644
af24d1
--- a/src/vdagent/display.c
af24d1
+++ b/src/vdagent/display.c
af24d1
@@ -60,6 +60,7 @@ struct VDAgentDisplay {
af24d1
     UdscsConnection *vdagentd;
af24d1
     int debug;
af24d1
     GIOChannel *x11_channel;
af24d1
+    guint io_watch_source_id;
af24d1
     VDAgentMutterDBus *mutter;
af24d1
 };
af24d1
 
af24d1
@@ -296,7 +297,8 @@ VDAgentDisplay* vdagent_display_create(UdscsConnection *vdagentd, int debug, int
af24d1
         return NULL;
af24d1
     }
af24d1
 
af24d1
-    g_io_add_watch(display->x11_channel, G_IO_IN, x11_io_channel_cb, display);
af24d1
+    display->io_watch_source_id =
af24d1
+        g_io_add_watch(display->x11_channel, G_IO_IN, x11_io_channel_cb, display);
af24d1
 
af24d1
 
af24d1
     /* Since we are started at the same time as the wm,
af24d1
@@ -323,7 +325,7 @@ void vdagent_display_destroy(VDAgentDisplay *display, int vdagentd_disconnected)
af24d1
         return;
af24d1
     }
af24d1
 
af24d1
-
af24d1
+    g_source_remove(display->io_watch_source_id);
af24d1
     g_clear_pointer(&display->x11_channel, g_io_channel_unref);
af24d1
     vdagent_x11_destroy(display->x11, vdagentd_disconnected);
af24d1
 
af24d1
-- 
af24d1
2.39.0
af24d1