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