From 07c54643bd284ed7f9f5e70f96fbb93dbdba50d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= Date: Mon, 29 Mar 2021 01:06:01 +0200 Subject: [PATCH] Reset source id to prevent double free Fixes in particular a GLib-CRITICAL when closing the prefs dialog. --- panel-plugin/netload.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c index 1659421..3908ef7 100644 --- a/panel-plugin/netload.c +++ b/panel-plugin/netload.c @@ -336,6 +336,7 @@ static void monitor_set_mode (XfcePanelPlugin *plugin, XfcePanelPluginMode mode, if (global->timeout_id) { g_source_remove(global->timeout_id); + global->timeout_id = 0; } if (mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR) @@ -408,6 +409,7 @@ static void monitor_free(XfcePanelPlugin *plugin, t_global_monitor *global) if (global->timeout_id) { g_source_remove(global->timeout_id); + global->timeout_id = 0; } if (global->monitor->options.label_text) @@ -554,7 +556,10 @@ static void setup_monitor(t_global_monitor *global, gboolean supress_warnings) gint i; if (global->timeout_id) + { g_source_remove(global->timeout_id); + global->timeout_id = 0; + } /* Show title label? */ if (global->monitor->options.use_label)