miniobject: avoid duplicate type check when freeing miniobject

gst_mini_object_unref() has guards that check the type already, so
we don't really need to re-check it here again while getting the
class (there's not really much point to that anyway, since we don't
check the return value of the get_class, so we'd crash anyway if
we're not dealing with a mini object, the only question would
be if there'd be a warning before the crash or not).
This commit is contained in:
Tim-Philipp Müller 2010-10-11 19:27:54 +01:00
parent 2c4afb966d
commit 0dbb0f203e

View file

@ -43,6 +43,9 @@
static GstAllocTrace *_gst_mini_object_trace; static GstAllocTrace *_gst_mini_object_trace;
#endif #endif
#define GST_MINI_OBJECT_GET_CLASS_UNCHECKED(obj) \
((GstMiniObjectClass *) (((GTypeInstance*)(obj))->g_class))
#if 0 #if 0
static void gst_mini_object_base_init (gpointer g_class); static void gst_mini_object_base_init (gpointer g_class);
static void gst_mini_object_base_finalize (gpointer g_class); static void gst_mini_object_base_finalize (gpointer g_class);
@ -330,7 +333,7 @@ gst_mini_object_free (GstMiniObject * mini_object)
g_atomic_int_inc (&mini_object->refcount); g_atomic_int_inc (&mini_object->refcount);
mo_class = GST_MINI_OBJECT_GET_CLASS (mini_object); mo_class = GST_MINI_OBJECT_GET_CLASS_UNCHECKED (mini_object);
mo_class->finalize (mini_object); mo_class->finalize (mini_object);
/* decrement the refcount again, if the subclass recycled the object we don't /* decrement the refcount again, if the subclass recycled the object we don't