]> git.0d.be Git - empathy.git/commitdiff
roster-window: unprepare the individual manager before destroying the roster
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 19 Jul 2012 08:41:23 +0000 (10:41 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 12 Sep 2012 09:49:25 +0000 (11:49 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=660128

src/empathy-roster-window.c

index 0ec35e14aef63c139e5c661797e7363066a867d9..c6a04fa89b624cf3c50809fa9c7b420643aab0b0 100644 (file)
@@ -943,6 +943,16 @@ roster_window_key_press_event_cb  (GtkWidget *window,
   return FALSE;
 }
 
+static void
+unprepare_cb (GObject *source,
+    GAsyncResult *result,
+    gpointer user_data)
+{
+  GtkWidget *self = user_data;
+
+  gtk_widget_destroy (self);
+}
+
 static void
 roster_window_chat_quit_cb (GSimpleAction *action,
     GVariant *parameter,
@@ -950,7 +960,14 @@ roster_window_chat_quit_cb (GSimpleAction *action,
 {
   EmpathyRosterWindow *self = user_data;
 
-  gtk_widget_destroy (GTK_WIDGET (self));
+  /* Destroying the window will make us leave the main loop and so exit the
+   * process. Before doing so we want to unprepare the individual manager.
+   * Just hide the window now and actually destroy it once Folks is done.
+   */
+  gtk_widget_hide (GTK_WIDGET (self));
+
+  empathy_individual_manager_unprepare_async (self->priv->individual_manager,
+      unprepare_cb, self);
 }
 
 static void