[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 01/05: Config dialog: Fix removing GSources.
noreply at xfce.org
noreply at xfce.org
Thu Oct 23 13:19:25 CEST 2014
This is an automated email from the git hooks/post-receive script.
hjudt pushed a commit to branch master
in repository panel-plugins/xfce4-weather-plugin.
commit e8a4c2b8e0e13740cb90228af317aab8d33d7492
Author: Harald Judt <h.judt at gmx.at>
Date: Wed Oct 22 00:54:25 2014 +0200
Config dialog: Fix removing GSources.
Check to see if a GSource exists before destroying it, since any GSource
may be destroyed early in the main event loop if its dispatch callback
returns FALSE.
---
panel-plugin/weather-config.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index 43824ab..51d79df 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -166,17 +166,25 @@ schedule_data_update(gpointer user_data)
static void
schedule_delayed_data_update(xfceweather_dialog *dialog)
{
+ GSource *source;
+
weather_debug("Starting delayed data update.");
/* cancel any update that was scheduled before */
if (dialog->timer_id) {
- g_source_remove(dialog->timer_id);
- dialog->timer_id = 0;
+ source = g_main_context_find_source_by_id(NULL, dialog->timer_id);
+ if (source) {
+ g_source_destroy(source);
+ dialog->timer_id = 0;
+ }
}
/* stop any updates that could be performed by weather.c */
if (dialog->pd->update_timer) {
- g_source_remove(dialog->pd->update_timer);
- dialog->pd->update_timer = 0;
+ source = g_main_context_find_source_by_id(NULL, dialog->pd->update_timer);
+ if (source) {
+ g_source_destroy(source);
+ dialog->pd->update_timer = 0;
+ }
}
gtk_widget_show(GTK_WIDGET(dialog->update_spinner));
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list