[gst-cvs] gstreamer: trace: include type name in leaked objects

Wim Taymans wtay at kemper.freedesktop.org
Wed Dec 23 12:39:39 PST 2009


Module: gstreamer
Branch: master
Commit: 7522e2ccf856790d353f52f36c1a1eaffdd300a8
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=7522e2ccf856790d353f52f36c1a1eaffdd300a8

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Wed Dec 23 21:37:51 2009 +0100

trace: include type name in leaked objects

When we are dealing with a GObject, print the type name along with
the pointer for easier debugging.

---

 gst/gsttrace.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gst/gsttrace.c b/gst/gsttrace.c
index 29f4987..70613a7 100644
--- a/gst/gsttrace.c
+++ b/gst/gsttrace.c
@@ -471,7 +471,13 @@ gst_alloc_trace_print (const GstAllocTrace * trace)
     mem_live = trace->mem_live;
 
     while (mem_live) {
-      g_print ("%-22.22s : %p\n", "", mem_live->data);
+      gpointer data = mem_live->data;
+
+      if (G_IS_OBJECT (data)) {
+        g_print ("%-22.22s : %p\n", g_type_name (G_OBJECT_TYPE (data)), data);
+      } else {
+        g_print ("%-22.22s : %p\n", "", data);
+      }
       mem_live = mem_live->next;
     }
   }





More information about the Gstreamer-commits mailing list