diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-10-11 19:27:54 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-10-11 19:55:52 +0100 |
commit | 0dbb0f203e23524f323045eb55c5e8dc4f1c124c (patch) | |
tree | dedfcbd506206b107383cb5d70dbc09dd65ab912 | |
parent | 2c4afb966d2b6c734eae96cbcf94bda04e796c05 (diff) |
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).
-rw-r--r-- | gst/gstminiobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/gstminiobject.c b/gst/gstminiobject.c index 2d128655e..8d9d7f19b 100644 --- a/gst/gstminiobject.c +++ b/gst/gstminiobject.c @@ -43,6 +43,9 @@ static GstAllocTrace *_gst_mini_object_trace; #endif +#define GST_MINI_OBJECT_GET_CLASS_UNCHECKED(obj) \ + ((GstMiniObjectClass *) (((GTypeInstance*)(obj))->g_class)) + #if 0 static void gst_mini_object_base_init (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); - mo_class = GST_MINI_OBJECT_GET_CLASS (mini_object); + mo_class = GST_MINI_OBJECT_GET_CLASS_UNCHECKED (mini_object); mo_class->finalize (mini_object); /* decrement the refcount again, if the subclass recycled the object we don't |