[empathy] roster-window: unprepare the individual manager before destroying the roster



commit b8863f14395f0e9e3201dd8bd2ffee938e7a50c9
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Jul 19 10:41:23 2012 +0200

    roster-window: unprepare the individual manager before destroying the roster
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660128

 src/empathy-roster-window.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c
index 0ec35e1..c6a04fa 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -944,13 +944,30 @@ roster_window_key_press_event_cb  (GtkWidget *window,
 }
 
 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,
     gpointer user_data)
 {
   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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]