[telepathy-gabble/telepathy-gabble-0.8] free shared caps cache when CM exits

Dafydd Harries dafydd.harries at collabora.co.uk
Tue Jan 12 12:15:33 PST 2010


---
 src/caps-cache.c         |    9 +++++++++
 src/caps-cache.h         |    3 +++
 src/connection-manager.c |    2 ++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/caps-cache.c b/src/caps-cache.c
index 1626baa..417396e 100644
--- a/src/caps-cache.c
+++ b/src/caps-cache.c
@@ -88,6 +88,15 @@ gabble_caps_cache_dup_shared (void)
   return shared_cache;
 }
 
+void
+gabble_caps_cache_free_shared (void)
+{
+  if (shared_cache != NULL)
+    {
+      g_object_unref (shared_cache);
+    }
+}
+
 gchar **
 gabble_caps_cache_lookup (GabbleCapsCache *self, const gchar *node)
 {
diff --git a/src/caps-cache.h b/src/caps-cache.h
index 0634c51..2afa6f6 100644
--- a/src/caps-cache.h
+++ b/src/caps-cache.h
@@ -62,6 +62,9 @@ gabble_caps_cache_new (void);
 GabbleCapsCache *
 gabble_caps_cache_dup_shared (void);
 
+void
+gabble_caps_cache_free_shared (void);
+
 G_END_DECLS
 
 #endif /* defined __GABBLE_CAPS_CACHE_H */
diff --git a/src/connection-manager.c b/src/connection-manager.c
index 17003b4..502dd99 100644
--- a/src/connection-manager.c
+++ b/src/connection-manager.c
@@ -28,6 +28,7 @@
 #include <telepathy-glib/dbus.h>
 #include <telepathy-glib/errors.h>
 
+#include "caps-cache.h"
 #include "connection.h"
 #include "debug.h"
 #include "debugger.h"
@@ -50,6 +51,7 @@ static TpBaseConnection *_gabble_connection_manager_new_connection (
 static void
 gabble_connection_manager_finalize (GObject *object)
 {
+  gabble_caps_cache_free_shared ();
   gabble_debug_free ();
   gabble_debugger_free_singleton ();
 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list