From 0c8c2b5bdd78f571374506f19d69addd4b904d92 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 4 Feb 2013 16:11:08 +0000 Subject: [PATCH] (gtk) #5271 'once we start shutting down the application, stop updating the Action states': fixed --- gtk/filter.c | 2 -- gtk/main.c | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gtk/filter.c b/gtk/filter.c index 15ffe6aae..5924fe3be 100644 --- a/gtk/filter.c +++ b/gtk/filter.c @@ -402,7 +402,6 @@ tracker_combo_box_new (GtkTreeModel * tmodel) c = gtk_combo_box_new_with_model (cat_model); c_combo_box = GTK_COMBO_BOX (c); c_cell_layout = GTK_CELL_LAYOUT (c); - g_object_unref (cat_model); gtk_combo_box_set_row_separator_func (c_combo_box, is_it_a_separator, NULL, NULL); gtk_combo_box_set_active (c_combo_box, 0); @@ -691,7 +690,6 @@ activity_combo_box_new (GtkTreeModel * tmodel) c = gtk_combo_box_new_with_model (activity_model); c_combo_box = GTK_COMBO_BOX (c); c_cell_layout = GTK_CELL_LAYOUT (c); - g_object_unref (activity_model); gtk_combo_box_set_row_separator_func (c_combo_box, activity_is_it_a_separator, NULL, NULL); gtk_combo_box_set_active (c_combo_box, 0); diff --git a/gtk/main.c b/gtk/main.c index 59ebcf804..fd1dd636d 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -73,6 +73,7 @@ struct cbdata char * config_dir; gboolean start_paused; gboolean is_iconified; + gboolean is_closing; guint activation_count; guint timer; @@ -87,7 +88,6 @@ struct cbdata GSList * duplicates_list; GSList * details; GtkTreeSelection * sel; - gpointer quit_dialog; }; static void @@ -275,7 +275,7 @@ refresh_actions_soon (gpointer gdata) { struct cbdata * data = gdata; - if (data->refresh_actions_tag == 0) + if (!data->is_closing && !data->refresh_actions_tag) data->refresh_actions_tag = gdk_threads_add_idle (refresh_actions, data); } @@ -916,9 +916,11 @@ static void on_app_exit (gpointer vdata) { GtkWidget *r, *p, *b, *w, *c; - struct cbdata *cbdata = vdata; + struct cbdata * cbdata = vdata; struct session_close_struct * session_close_data; + cbdata->is_closing = true; + /* stop the update timer */ if (cbdata->timer) { @@ -926,6 +928,13 @@ on_app_exit (gpointer vdata) cbdata->timer = 0; } + /* stop the refresh-actions timer */ + if (cbdata->refresh_actions_tag) + { + g_source_remove (cbdata->refresh_actions_tag); + cbdata->refresh_actions_tag = 0; + } + c = GTK_WIDGET (cbdata->wind); gtk_container_remove (GTK_CONTAINER (c), gtk_bin_get_child (GTK_BIN (c))); -- 2.40.0