From eda4386f98cb8169e122c2137d6c4eb6be6f5e8b Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 6 Jul 2001 13:00:48 +0000 Subject: Make sure that after the finalization event has happened and the 2001-07-06 Peter Williams * camel-object.c (camel_object_unref): Make sure that after the finalization event has happened and the finalization functions have been called that the object still has a zero refcount. svn path=/trunk/; revision=10844 --- camel/ChangeLog | 6 ++++++ camel/camel-object.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/camel/ChangeLog b/camel/ChangeLog index 658c96c3e0..81fd8868fa 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2001-07-06 Peter Williams + + * camel-object.c (camel_object_unref): Make sure that after the + finalization event has happened and the finalization functions + have been called that the object still has a zero refcount. + 2001-07-06 Joe Shaw * providers/nntp/camel-nntp-grouplist.c: Add locking to diff --git a/camel/camel-object.c b/camel/camel-object.c index daa83284c0..7d6f38a55b 100644 --- a/camel/camel-object.c +++ b/camel/camel-object.c @@ -545,6 +545,14 @@ camel_object_unref (CamelObject * obj) g_slist_free (head); + /* Sanity check */ + + if (obj->ref_count != 0) + g_warning ("camel_object_unref: destroyed object %s at %p somehow got" + " referenced in destruction chain.", + camel_type_to_name (obj->s.type), + obj); + /* A little bit of cleaning up. * Don't erase the type, so we can peek at it if a finalized object -- cgit