diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2006-08-10 12:08:51 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@src.gnome.org> | 2006-08-10 12:08:51 +0000 |
commit | 490bdc1dddfb20114ddb8bee6fc021797d13ff03 (patch) | |
tree | ee18574ce8d35e04bd37b608a231ca08168ba72f /gtk | |
parent | 3f94923850a2d64af0d88912c6c11052bf946e89 (diff) | |
download | gtk+-490bdc1dddfb20114ddb8bee6fc021797d13ff03.tar.gz |
Remove the idle source in ::finalize...
2006-08-10 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchoosermenu.c:
(gtk_recent_chooser_menu_finalize): Remove the idle
source in ::finalize...
(idle_populate_func),
(idle_populate_clean_up): ...and reset the idle source
id at the end of the idle loop while we hold the GDK mutex
lock. (#350605, reported by Wouter Bolsterlee, patch by
Chris Wilson)
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkrecentchoosermenu.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c index 54ee86302e..1e066744b3 100644 --- a/gtk/gtkrecentchoosermenu.c +++ b/gtk/gtkrecentchoosermenu.c @@ -250,6 +250,9 @@ gtk_recent_chooser_menu_finalize (GObject *object) g_signal_handler_disconnect (priv->manager, priv->manager_changed_id); priv->manager_changed_id = 0; + if (priv->populate_id) + g_source_remove (priv->populate_id); + priv->manager = NULL; if (priv->sort_data_destroy) @@ -952,7 +955,10 @@ idle_populate_func (gpointer data) GDK_THREADS_ENTER (); pdata = (MenuPopulateData *) data; - + priv = pdata->menu->priv; + + priv->populate_id = 0; + if (!pdata->items) { pdata->items = gtk_recent_chooser_get_items (GTK_RECENT_CHOOSER (pdata->menu)); @@ -984,7 +990,6 @@ idle_populate_func (gpointer data) } info = g_list_nth_data (pdata->items, pdata->loaded_items); - priv = pdata->menu->priv; /* skip non-local items on request */ if (priv->local_only && @@ -1062,11 +1067,7 @@ check_and_return: static void idle_populate_clean_up (gpointer data) { - MenuPopulateData *pdata = data; - - pdata->menu->priv->populate_id = 0; - - g_slice_free (MenuPopulateData, pdata); + g_slice_free (MenuPopulateData, data); } static void |