mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
trace: don't check random pointers for objects
Only see if the traced pointer is a GObject when it was registered with the special offset of -2.
This commit is contained in:
parent
e60b67f907
commit
5d6999f804
2 changed files with 9 additions and 6 deletions
|
@ -205,7 +205,7 @@ gst_object_class_init (GstObjectClass * klass)
|
|||
|
||||
#ifndef GST_DISABLE_TRACE
|
||||
_gst_object_trace =
|
||||
_gst_alloc_trace_register (g_type_name (GST_TYPE_OBJECT), 0);
|
||||
_gst_alloc_trace_register (g_type_name (GST_TYPE_OBJECT), -2);
|
||||
#endif
|
||||
|
||||
gobject_class->set_property = gst_object_set_property;
|
||||
|
|
|
@ -168,15 +168,18 @@ gst_alloc_trace_print (const GstAllocTrace * trace)
|
|||
gpointer data = mem_live->data;
|
||||
const gchar *type_name;
|
||||
|
||||
if (G_IS_OBJECT (data)) {
|
||||
type_name = G_OBJECT_TYPE_NAME (data);
|
||||
} else if (trace->offset != -1) {
|
||||
if (trace->offset == -2) {
|
||||
if (G_IS_OBJECT (data))
|
||||
type_name = G_OBJECT_TYPE_NAME (data);
|
||||
else
|
||||
type_name = "<invalid>";
|
||||
} else if (trace->offset == -1) {
|
||||
type_name = "<unknown>";
|
||||
} else {
|
||||
GType type;
|
||||
|
||||
type = G_STRUCT_MEMBER (GType, data, trace->offset);
|
||||
type_name = g_type_name (type);
|
||||
} else {
|
||||
type_name = "";
|
||||
}
|
||||
|
||||
g_print (" %-20.20s : %p\n", type_name, data);
|
||||
|
|
Loading…
Reference in a new issue