From 3f395fce0fe950a5fb6959f01469e512ce81f377 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 28 May 2009 14:47:27 +0200 Subject: Bug #535516 - Crash in GConf Bridge while replying A test patch, maybe not fixing the bug fully, but let's try it. --- e-util/gconf-bridge.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'e-util/gconf-bridge.c') diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c index 060c26ccc7..9630bbf916 100644 --- a/e-util/gconf-bridge.c +++ b/e-util/gconf-bridge.c @@ -649,16 +649,16 @@ window_binding_configure_event_cb (GtkWindow *window, GdkEventConfigure *event, WindowBinding *binding) { - /* Schedule a sync */ - if (binding->sync_timeout_id == 0) { - binding->sync_timeout_id = - g_timeout_add_seconds (WINDOW_BINDING_SYNC_DELAY, - (GSourceFunc) - window_binding_perform_scheduled_sync, - binding); - } + /* re-postpone by cancel of the previous request */ + if (binding->sync_timeout_id > 0) + g_source_remove (binding->sync_timeout_id); - return FALSE; + /* Schedule a sync */ + binding->sync_timeout_id = g_timeout_add_seconds (WINDOW_BINDING_SYNC_DELAY, + (GSourceFunc) window_binding_perform_scheduled_sync, + binding); + + return FALSE; } /* Called when the window state is being changed */ @@ -667,6 +667,9 @@ window_binding_state_event_cb (GtkWindow *window, GdkEventWindowState *event, WindowBinding *binding) { + if (binding->sync_timeout_id > 0) + g_source_remove (binding->sync_timeout_id); + window_binding_perform_scheduled_sync (binding); return FALSE; @@ -697,6 +700,9 @@ window_binding_window_destroyed (gpointer user_data, binding->window = NULL; /* Don't do anything with the window at unbind() */ + if (binding->sync_timeout_id > 0) + g_source_remove (binding->sync_timeout_id); + g_hash_table_remove (bridge->bindings, GUINT_TO_POINTER (binding->id)); } -- cgit v1.2.3