[Galago-commits] r2699 - in trunk/libgalago: . libgalago
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Tue Apr 11 00:00:31 PDT 2006
Author: chipx86
Date: 2006-04-11 00:00:24 -0700 (Tue, 11 Apr 2006)
New Revision: 2699
Modified:
trunk/libgalago/ChangeLog
trunk/libgalago/libgalago/galago-account.c
trunk/libgalago/libgalago/galago-context.c
trunk/libgalago/libgalago/galago-object.c
trunk/libgalago/libgalago/galago-person.c
Log:
Start sprinkling back some g_object_unref() calls, and add some debugging.
Modified: trunk/libgalago/ChangeLog
===================================================================
--- trunk/libgalago/ChangeLog 2006-04-11 05:46:00 UTC (rev 2698)
+++ trunk/libgalago/ChangeLog 2006-04-11 07:00:24 UTC (rev 2699)
@@ -1,3 +1,12 @@
+Mon Apr 10 23:59:30 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * libgalago/galago-account.c:
+ * libgalago/galago-context.c:
+ * libgalago/galago-object.c:
+ * libgalago/galago-person.c:
+ - Start sprinkling back some g_object_unref() calls, and add some
+ debugging.
+
Mon Apr 10 21:30:44 PDT 2006 Christian Hammond <chipx86 at chipx86.com>
* libgalago/galago-core.c:
Modified: trunk/libgalago/libgalago/galago-account.c
===================================================================
--- trunk/libgalago/libgalago/galago-account.c 2006-04-11 05:46:00 UTC (rev 2698)
+++ trunk/libgalago/libgalago/galago-account.c 2006-04-11 07:00:24 UTC (rev 2699)
@@ -916,8 +916,10 @@
{
GalagoPresence *old_presence = account->priv->presence;
account->priv->presence = NULL;
- galago_object_destroy(GALAGO_OBJECT(old_presence));
+ if (!GALAGO_OBJECT_HAS_FLAG(old_presence, GALAGO_OBJECT_IN_DESTRUCTION))
+ g_object_unref(G_OBJECT(old_presence));
+
emit_deleted = (presence == NULL);
}
Modified: trunk/libgalago/libgalago/galago-context.c
===================================================================
--- trunk/libgalago/libgalago/galago-context.c 2006-04-11 05:46:00 UTC (rev 2698)
+++ trunk/libgalago/libgalago/galago-context.c 2006-04-11 07:00:24 UTC (rev 2699)
@@ -168,20 +168,34 @@
}
static void
+remove_object(GObject *object)
+{
+ printf("Unreffing..\n");
+ g_object_unref(G_OBJECT(object));
+
+ if (object->ref_count > 0)
+ {
+ printf("Object %p (%s) has ref count of %d\n",
+ object, G_OBJECT_TYPE_NAME(object), object->ref_count);
+ }
+}
+
+static void
galago_context_destroy(GalagoObject *object)
{
GalagoContext *context = GALAGO_CONTEXT(object);
if (context->priv != NULL)
{
+ printf("Releasing refs..\n");
g_list_foreach(context->priv->local.services,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
g_list_foreach(context->priv->remote.services,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
g_list_foreach(context->priv->local.people,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
g_list_foreach(context->priv->remote.people,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
g_hash_table_destroy(context->priv->services_table);
g_hash_table_destroy(context->priv->people_table);
@@ -723,9 +737,9 @@
{
case GALAGO_LOCAL:
g_list_foreach(context->priv->local.services,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
g_list_foreach(context->priv->local.people,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
context->priv->local.services = NULL;
context->priv->local.people = NULL;
@@ -733,9 +747,9 @@
case GALAGO_REMOTE:
g_list_foreach(context->priv->remote.services,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
g_list_foreach(context->priv->remote.people,
- (GFunc)galago_object_destroy, NULL);
+ (GFunc)remove_object, NULL);
context->priv->remote.services = NULL;
context->priv->remote.people = NULL;
Modified: trunk/libgalago/libgalago/galago-object.c
===================================================================
--- trunk/libgalago/libgalago/galago-object.c 2006-04-11 05:46:00 UTC (rev 2698)
+++ trunk/libgalago/libgalago/galago-object.c 2006-04-11 07:00:24 UTC (rev 2699)
@@ -165,6 +165,8 @@
{
GalagoObject *object = GALAGO_OBJECT(gobject);
+ printf("Finalizing object %p (%s)\n", gobject, G_OBJECT_TYPE_NAME(gobject));
+
if (object->priv != NULL)
{
if (object->priv->dbus_path != NULL)
@@ -259,8 +261,11 @@
g_return_if_fail(object != NULL);
g_return_if_fail(GALAGO_IS_OBJECT(object));
+ g_object_unref(G_OBJECT(object));
+#if 0
if (!GALAGO_OBJECT_HAS_FLAG(object, GALAGO_OBJECT_IN_DESTRUCTION))
g_object_run_dispose(G_OBJECT(object));
+#endif
}
const gchar *
Modified: trunk/libgalago/libgalago/galago-person.c
===================================================================
--- trunk/libgalago/libgalago/galago-person.c 2006-04-11 05:46:00 UTC (rev 2698)
+++ trunk/libgalago/libgalago/galago-person.c 2006-04-11 07:00:24 UTC (rev 2699)
@@ -524,7 +524,7 @@
{
GalagoImage *old_photo = person->priv->photo;
person->priv->photo = NULL;
- galago_object_destroy(GALAGO_OBJECT(old_photo));
+ g_object_unref(G_OBJECT(old_photo));
}
person->priv->photo = photo;
More information about the galago-commits
mailing list