]> granicus.if.org Git - transmission/commitdiff
(gtk) #5271 'once we start shutting down the application, stop updating the Action...
authorJordan Lee <jordan@transmissionbt.com>
Mon, 4 Feb 2013 16:11:08 +0000 (16:11 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Mon, 4 Feb 2013 16:11:08 +0000 (16:11 +0000)
gtk/filter.c
gtk/main.c

index 15ffe6aaee9889a9cf1f62ce4f63c6aebb00b35e..5924fe3be53fca7573139812e40e5492bf2bbf0a 100644 (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);
index 59ebcf804e2b5f299da0f212337d95be9c56e969..fd1dd636d2f13553aef3b6b958c86953bf21299b 100644 (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)));