(gtk) #5271 'once we start shutting down the application, stop updating the Action states': fixed

This commit is contained in:
Jordan Lee 2013-02-04 16:11:08 +00:00
parent 5475e1507e
commit 0c8c2b5bdd
2 changed files with 12 additions and 5 deletions

View File

@ -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);

View File

@ -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)));