diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-09-10 19:12:50 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2009-09-10 19:12:50 +0100 |
commit | 57d9f1eeace13a9948f602f7ac01ee532b883efb (patch) | |
tree | 6d53a99dc5ab50ce08561ec93208b9c5a8ead2de /src/mcd-debug.c | |
parent | 6614dda6bfba2c62ec68ac3952cc0d56ed90edb4 (diff) | |
download | telepathy-mission-control-57d9f1eeace13a9948f602f7ac01ee532b883efb.tar.gz |
mcd_debug_[un]ref: deprecate, and stop overriding g_object_[un]ref
The output from these turns out not to be as useful as you might think:
about half the refs and unrefs happen somewhere in the bowels of GObject
(e.g. g_value_dup_object creates a ref without calling mcd_debug_ref),
so the debug log, while verbose, doesn't actually provide enough
information to locate leaks.
refdbg is what I actually ended up using to find leaks during 5.1
development; it works considerably better in practice, and doesn't require
source code modification (or namespace pollution).
Diffstat (limited to 'src/mcd-debug.c')
-rw-r--r-- | src/mcd-debug.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/mcd-debug.c b/src/mcd-debug.c index 3c4e9f94..8130b70d 100644 --- a/src/mcd-debug.c +++ b/src/mcd-debug.c @@ -44,30 +44,19 @@ gint mcd_debug_level = 0; gpointer -mcd_debug_ref (gpointer obj, const gchar *filename, gint linenum) +mcd_debug_ref (gpointer obj, + const gchar *filename G_GNUC_UNUSED, + gint linenum G_GNUC_UNUSED) { - /* Function reference untouchable by macro processing */ - gpointer (*untouchable_ref) (gpointer object); - - untouchable_ref = g_object_ref; - if (mcd_debug_level >= 2) - g_debug ("[%s:%d]: Referencing (%d) object %p of type %s", - filename, linenum, G_OBJECT (obj)->ref_count, - obj, G_OBJECT_TYPE_NAME(obj)); - return untouchable_ref (obj); + return g_object_ref (obj); } void -mcd_debug_unref (gpointer obj, const gchar *filename, gint linenum) +mcd_debug_unref (gpointer obj, + const gchar *filename G_GNUC_UNUSED, + gint linenum G_GNUC_UNUSED) { - void (*untouchable_unref) (gpointer object); - - untouchable_unref = g_object_unref; - if (mcd_debug_level >= 2) - g_debug ("[%s:%d]: Unreferencing (%d) object %p of type %s", - filename, linenum, G_OBJECT (obj)->ref_count, obj, - G_OBJECT_TYPE_NAME(obj)); - untouchable_unref (obj); + g_object_unref (obj); } static void |