Commit 109511b5 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Properly chain up finalize functions to the parent class.

Original commit message from CVS:
* 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.
parent fdd893cd
2008-02-12 Sebastian Dröge <slomo@circular-chaos.org>
* 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 <wim.taymans@collabora.co.uk> 2008-02-11 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Siavash Safi <siavash dot safi at gmail dot com> Patch by: Siavash Safi <siavash dot safi at gmail dot com>
......
...@@ -129,6 +129,8 @@ static GType gst_subbuffer_get_type (void); ...@@ -129,6 +129,8 @@ static GType gst_subbuffer_get_type (void);
static GType _gst_subbuffer_type = 0; static GType _gst_subbuffer_type = 0;
static GType _gst_buffer_type = 0; static GType _gst_buffer_type = 0;
static GstMiniObjectClass *parent_class = NULL;
void void
_gst_buffer_initialize (void) _gst_buffer_initialize (void)
{ {
...@@ -167,6 +169,8 @@ gst_buffer_class_init (gpointer g_class, gpointer class_data) ...@@ -167,6 +169,8 @@ gst_buffer_class_init (gpointer g_class, gpointer class_data)
{ {
GstBufferClass *buffer_class = GST_BUFFER_CLASS (g_class); GstBufferClass *buffer_class = GST_BUFFER_CLASS (g_class);
parent_class = g_type_class_peek_parent (g_class);
buffer_class->mini_object_class.copy = buffer_class->mini_object_class.copy =
(GstMiniObjectCopyFunction) _gst_buffer_copy; (GstMiniObjectCopyFunction) _gst_buffer_copy;
buffer_class->mini_object_class.finalize = buffer_class->mini_object_class.finalize =
...@@ -185,6 +189,8 @@ gst_buffer_finalize (GstBuffer * buffer) ...@@ -185,6 +189,8 @@ gst_buffer_finalize (GstBuffer * buffer)
g_free (buffer->malloc_data); g_free (buffer->malloc_data);
gst_caps_replace (&GST_BUFFER_CAPS (buffer), NULL); gst_caps_replace (&GST_BUFFER_CAPS (buffer), NULL);
GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (buffer));
} }
/** /**
......
...@@ -89,6 +89,8 @@ static void gst_event_class_init (gpointer g_class, gpointer class_data); ...@@ -89,6 +89,8 @@ static void gst_event_class_init (gpointer g_class, gpointer class_data);
static void gst_event_finalize (GstEvent * event); static void gst_event_finalize (GstEvent * event);
static GstEvent *_gst_event_copy (GstEvent * event); static GstEvent *_gst_event_copy (GstEvent * event);
static GstMiniObjectClass *parent_class = NULL;
void void
_gst_event_initialize (void) _gst_event_initialize (void)
{ {
...@@ -219,6 +221,8 @@ gst_event_class_init (gpointer g_class, gpointer class_data) ...@@ -219,6 +221,8 @@ gst_event_class_init (gpointer g_class, gpointer class_data)
{ {
GstEventClass *event_class = GST_EVENT_CLASS (g_class); GstEventClass *event_class = GST_EVENT_CLASS (g_class);
parent_class = g_type_class_peek_parent (g_class);
event_class->mini_object_class.copy = event_class->mini_object_class.copy =
(GstMiniObjectCopyFunction) _gst_event_copy; (GstMiniObjectCopyFunction) _gst_event_copy;
event_class->mini_object_class.finalize = event_class->mini_object_class.finalize =
...@@ -252,6 +256,8 @@ gst_event_finalize (GstEvent * event) ...@@ -252,6 +256,8 @@ gst_event_finalize (GstEvent * event)
gst_structure_set_parent_refcount (event->structure, NULL); gst_structure_set_parent_refcount (event->structure, NULL);
gst_structure_free (event->structure); gst_structure_free (event->structure);
} }
GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (event));
} }
static GstEvent * static GstEvent *
......
...@@ -64,6 +64,8 @@ static void gst_message_class_init (gpointer g_class, gpointer class_data); ...@@ -64,6 +64,8 @@ static void gst_message_class_init (gpointer g_class, gpointer class_data);
static void gst_message_finalize (GstMessage * message); static void gst_message_finalize (GstMessage * message);
static GstMessage *_gst_message_copy (GstMessage * message); static GstMessage *_gst_message_copy (GstMessage * message);
static GstMiniObjectClass *parent_class = NULL;
void void
_gst_message_initialize (void) _gst_message_initialize (void)
{ {
...@@ -185,6 +187,8 @@ gst_message_class_init (gpointer g_class, gpointer class_data) ...@@ -185,6 +187,8 @@ gst_message_class_init (gpointer g_class, gpointer class_data)
{ {
GstMessageClass *message_class = GST_MESSAGE_CLASS (g_class); GstMessageClass *message_class = GST_MESSAGE_CLASS (g_class);
parent_class = g_type_class_peek_parent (g_class);
message_class->mini_object_class.copy = message_class->mini_object_class.copy =
(GstMiniObjectCopyFunction) _gst_message_copy; (GstMiniObjectCopyFunction) _gst_message_copy;
message_class->mini_object_class.finalize = message_class->mini_object_class.finalize =
...@@ -222,6 +226,8 @@ gst_message_finalize (GstMessage * message) ...@@ -222,6 +226,8 @@ gst_message_finalize (GstMessage * message)
gst_structure_set_parent_refcount (message->structure, NULL); gst_structure_set_parent_refcount (message->structure, NULL);
gst_structure_free (message->structure); gst_structure_free (message->structure);
} }
GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (message));
} }
static GstMessage * static GstMessage *
......
...@@ -79,6 +79,8 @@ static GHashTable *_nick_to_query = NULL; ...@@ -79,6 +79,8 @@ static GHashTable *_nick_to_query = NULL;
static GHashTable *_query_type_to_nick = NULL; static GHashTable *_query_type_to_nick = NULL;
static guint32 _n_values = 1; /* we start from 1 because 0 reserved for NONE */ static guint32 _n_values = 1; /* we start from 1 because 0 reserved for NONE */
static GstMiniObjectClass *parent_class = NULL;
static GstQueryTypeDefinition standard_definitions[] = { static GstQueryTypeDefinition standard_definitions[] = {
{GST_QUERY_POSITION, "position", "Current position", 0}, {GST_QUERY_POSITION, "position", "Current position", 0},
{GST_QUERY_DURATION, "duration", "Total duration", 0}, {GST_QUERY_DURATION, "duration", "Total duration", 0},
...@@ -188,6 +190,8 @@ gst_query_class_init (gpointer g_class, gpointer class_data) ...@@ -188,6 +190,8 @@ gst_query_class_init (gpointer g_class, gpointer class_data)
{ {
GstQueryClass *query_class = GST_QUERY_CLASS (g_class); GstQueryClass *query_class = GST_QUERY_CLASS (g_class);
parent_class = g_type_class_peek_parent (g_class);
query_class->mini_object_class.copy = query_class->mini_object_class.copy =
(GstMiniObjectCopyFunction) _gst_query_copy; (GstMiniObjectCopyFunction) _gst_query_copy;
query_class->mini_object_class.finalize = query_class->mini_object_class.finalize =
...@@ -204,6 +208,8 @@ gst_query_finalize (GstQuery * query) ...@@ -204,6 +208,8 @@ gst_query_finalize (GstQuery * query)
gst_structure_set_parent_refcount (query->structure, NULL); gst_structure_set_parent_refcount (query->structure, NULL);
gst_structure_free (query->structure); gst_structure_free (query->structure);
} }
GST_MINI_OBJECT_CLASS (parent_class)->finalize (GST_MINI_OBJECT (query));
} }
static GstQuery * static GstQuery *
......
...@@ -442,6 +442,7 @@ struct _GstMmapBufferClass ...@@ -442,6 +442,7 @@ struct _GstMmapBufferClass
static void gst_mmap_buffer_init (GTypeInstance * instance, gpointer g_class); 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_class_init (gpointer g_class, gpointer class_data);
static void gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer); static void gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer);
static GstBufferClass *mmap_buffer_parent_class = NULL;
static GType static GType
gst_mmap_buffer_get_type (void) gst_mmap_buffer_get_type (void)
...@@ -473,6 +474,8 @@ gst_mmap_buffer_class_init (gpointer g_class, gpointer class_data) ...@@ -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); 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 = mini_object_class->finalize =
(GstMiniObjectFinalizeFunction) gst_mmap_buffer_finalize; (GstMiniObjectFinalizeFunction) gst_mmap_buffer_finalize;
} }
...@@ -521,6 +524,9 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer) ...@@ -521,6 +524,9 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer)
* guint64 as hex */ * guint64 as hex */
GST_LOG ("unmapped region %08lx+%08lx at %p", GST_LOG ("unmapped region %08lx+%08lx at %p",
(gulong) offset, (gulong) size, data); (gulong) offset, (gulong) size, data);
GST_MINI_OBJECT_CLASS (mmap_buffer_parent_class)->
finalize (GST_MINI_OBJECT (mmap_buffer));
} }
static GstBuffer * static GstBuffer *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment