From 416a4f18cf4d0cc3126f9628165612477c4d7092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 19 Sep 2007 12:50:27 +0000 Subject: ext/directfb/dfbvideosink.c: When finalizing GstDfbSurface, a subclass of GstBuffer, correctly chain up to the parent... Original commit message from CVS: * ext/directfb/dfbvideosink.c: (gst_dfbvideosink_surface_destroy), (gst_dfbsurface_class_init): When finalizing GstDfbSurface, a subclass of GstBuffer, correctly chain up to the parent class to free everything, including caps. --- ext/directfb/dfbvideosink.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ext') diff --git a/ext/directfb/dfbvideosink.c b/ext/directfb/dfbvideosink.c index 92bd61b3..7f8f1092 100644 --- a/ext/directfb/dfbvideosink.c +++ b/ext/directfb/dfbvideosink.c @@ -144,6 +144,7 @@ static void gst_dfbvideosink_surface_destroy (GstDfbVideoSink * dfbvideosink, GstDfbSurface * surface); static GstVideoSinkClass *parent_class = NULL; +static GstBufferClass *surface_parent_class = NULL; static const char * gst_dfbvideosink_get_format_name (DFBSurfacePixelFormat format) @@ -328,18 +329,14 @@ gst_dfbvideosink_surface_destroy (GstDfbVideoSink * dfbvideosink, surface->surface = NULL; } - if (GST_BUFFER (surface)->malloc_data) { - g_free (GST_BUFFER (surface)->malloc_data); - GST_BUFFER (surface)->malloc_data = NULL; - } - if (surface->dfbvideosink) { /* Release the ref to our sink */ surface->dfbvideosink = NULL; gst_object_unref (dfbvideosink); } - return; + GST_MINI_OBJECT_CLASS (surface_parent_class)-> + finalize (GST_MINI_OBJECT (surface)); } static gpointer @@ -1891,6 +1888,8 @@ gst_dfbsurface_class_init (gpointer g_class, gpointer class_data) { GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class); + surface_parent_class = g_type_class_peek_parent (g_class); + mini_object_class->finalize = (GstMiniObjectFinalizeFunction) gst_dfbsurface_finalize; } -- cgit v1.2.1