[empathy] notify-manager: unref the account mgr when disposing
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: svn-commits-list gnome org
- Cc: 
- Subject: [empathy] notify-manager: unref the account mgr when disposing
- Date: Wed, 18 Nov 2009 23:13:56 +0000 (UTC)
commit eaf0587c3c9d674eca2350dec5a2f5c87705f402
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Nov 18 23:09:53 2009 +0000
    notify-manager: unref the account mgr when disposing
 libempathy-gtk/empathy-notify-manager.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c
index 67e39ef..8f79911 100644
--- a/libempathy-gtk/empathy-notify-manager.c
+++ b/libempathy-gtk/empathy-notify-manager.c
@@ -68,6 +68,20 @@ notify_manager_constructor (GType type,
 }
 
 static void
+notify_manager_dispose (GObject *object)
+{
+  EmpathyNotifyManagerPriv *priv = GET_PRIV (object);
+
+  if (priv->account_manager != NULL)
+    {
+      g_object_unref (priv->account_manager);
+      priv->account_manager = NULL;
+    }
+
+  G_OBJECT_CLASS (empathy_notify_manager_parent_class)->dispose (object);
+}
+
+static void
 notify_manager_finalize (GObject *object)
 {
   EmpathyNotifyManagerPriv *priv = GET_PRIV (object);
@@ -82,6 +96,7 @@ empathy_notify_manager_class_init (EmpathyNotifyManagerClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  object_class->dispose = notify_manager_dispose;
   object_class->finalize = notify_manager_finalize;
   object_class->constructor = notify_manager_constructor;
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]