diff --git a/ChangeLog b/ChangeLog index a2847360e1..abef797931 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-02-12 Sebastian Dröge + + * gst/gstbuffer.c: (gst_buffer_class_init), (gst_buffer_finalize): + * gst/gstevent.c: (gst_event_class_init), (gst_event_finalize): + * gst/gstmessage.c: (gst_message_class_init), + (gst_message_finalize): + * gst/gstquery.c: (gst_query_class_init), (gst_query_finalize): + * plugins/elements/gstfilesrc.c: (gst_mmap_buffer_class_init), + (gst_mmap_buffer_finalize): + Properly chain up finalize functions to the parent class. + 2008-02-11 Wim Taymans Patch by: Siavash Safi diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 30e92ebefe..7d7eca040d 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -129,6 +129,8 @@ static GType gst_subbuffer_get_type (void); static GType _gst_subbuffer_type = 0; static GType _gst_buffer_type = 0; +static GstMiniObjectClass *parent_class = NULL; + void _gst_buffer_initialize (void) { @@ -167,6 +169,8 @@ gst_buffer_class_init (gpointer g_class, gpointer class_data) { GstBufferClass *buffer_class = GST_BUFFER_CLASS (g_class); + parent_class = g_type_class_peek_parent (g_class); + buffer_class->mini_object_class.copy = (GstMiniObjectCopyFunction) _gst_buffer_copy; buffer_class->mini_object_class.finalize = @@ -185,6 +189,8 @@ gst_buffer_finalize (GstBuffer * buffer) g_free (buffer->malloc_data); gst_caps_replace (&GST_BUFFER_CAPS (buffer), NULL); + + GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (buffer)); } /** diff --git a/gst/gstevent.c b/gst/gstevent.c index fcc2c74de7..8ba71b0add 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -89,6 +89,8 @@ static void gst_event_class_init (gpointer g_class, gpointer class_data); static void gst_event_finalize (GstEvent * event); static GstEvent *_gst_event_copy (GstEvent * event); +static GstMiniObjectClass *parent_class = NULL; + void _gst_event_initialize (void) { @@ -219,6 +221,8 @@ gst_event_class_init (gpointer g_class, gpointer class_data) { GstEventClass *event_class = GST_EVENT_CLASS (g_class); + parent_class = g_type_class_peek_parent (g_class); + event_class->mini_object_class.copy = (GstMiniObjectCopyFunction) _gst_event_copy; event_class->mini_object_class.finalize = @@ -252,6 +256,8 @@ gst_event_finalize (GstEvent * event) gst_structure_set_parent_refcount (event->structure, NULL); gst_structure_free (event->structure); } + + GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (event)); } static GstEvent * diff --git a/gst/gstmessage.c b/gst/gstmessage.c index 820d3e2e7a..b2d706dc0d 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -64,6 +64,8 @@ static void gst_message_class_init (gpointer g_class, gpointer class_data); static void gst_message_finalize (GstMessage * message); static GstMessage *_gst_message_copy (GstMessage * message); +static GstMiniObjectClass *parent_class = NULL; + void _gst_message_initialize (void) { @@ -185,6 +187,8 @@ gst_message_class_init (gpointer g_class, gpointer class_data) { GstMessageClass *message_class = GST_MESSAGE_CLASS (g_class); + parent_class = g_type_class_peek_parent (g_class); + message_class->mini_object_class.copy = (GstMiniObjectCopyFunction) _gst_message_copy; message_class->mini_object_class.finalize = @@ -222,6 +226,8 @@ gst_message_finalize (GstMessage * message) gst_structure_set_parent_refcount (message->structure, NULL); gst_structure_free (message->structure); } + + GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (message)); } static GstMessage * diff --git a/gst/gstquery.c b/gst/gstquery.c index fde1d61a3d..315aea9018 100644 --- a/gst/gstquery.c +++ b/gst/gstquery.c @@ -79,6 +79,8 @@ static GHashTable *_nick_to_query = NULL; static GHashTable *_query_type_to_nick = NULL; static guint32 _n_values = 1; /* we start from 1 because 0 reserved for NONE */ +static GstMiniObjectClass *parent_class = NULL; + static GstQueryTypeDefinition standard_definitions[] = { {GST_QUERY_POSITION, "position", "Current position", 0}, {GST_QUERY_DURATION, "duration", "Total duration", 0}, @@ -188,6 +190,8 @@ gst_query_class_init (gpointer g_class, gpointer class_data) { GstQueryClass *query_class = GST_QUERY_CLASS (g_class); + parent_class = g_type_class_peek_parent (g_class); + query_class->mini_object_class.copy = (GstMiniObjectCopyFunction) _gst_query_copy; query_class->mini_object_class.finalize = @@ -204,6 +208,8 @@ gst_query_finalize (GstQuery * query) gst_structure_set_parent_refcount (query->structure, NULL); gst_structure_free (query->structure); } + + GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (query)); } static GstQuery * diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 55a82e688a..ac299d4e94 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -442,6 +442,7 @@ struct _GstMmapBufferClass static void gst_mmap_buffer_init (GTypeInstance * instance, gpointer g_class); static void gst_mmap_buffer_class_init (gpointer g_class, gpointer class_data); static void gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer); +static GstBufferClass *mmap_buffer_parent_class = NULL; static GType gst_mmap_buffer_get_type (void) @@ -473,6 +474,8 @@ gst_mmap_buffer_class_init (gpointer g_class, gpointer class_data) { GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class); + mmap_buffer_parent_class = g_type_class_peek_parent (g_class); + mini_object_class->finalize = (GstMiniObjectFinalizeFunction) gst_mmap_buffer_finalize; } @@ -521,6 +524,9 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer) * guint64 as hex */ GST_LOG ("unmapped region %08lx+%08lx at %p", (gulong) offset, (gulong) size, data); + + GST_MINI_OBJECT_CLASS (mmap_buffer_parent_class)-> + finalize (GST_MINI_OBJECT (mmap_buffer)); } static GstBuffer *