sys/directdraw/gstdirectdrawsink.c: Properly chain up finalize functions. Fixes bug #515980.

Original commit message from CVS:
* sys/directdraw/gstdirectdrawsink.c:
(gst_ddrawsurface_class_init), (gst_ddrawsurface_finalize),
(gst_directdraw_sink_finalize):
Properly chain up finalize functions. Fixes bug #515980.
This commit is contained in:
Sebastian Dröge 2008-02-12 12:22:48 +00:00
parent 45aeb687d2
commit d62d8d9fea
3 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2008-02-12 Sebastian Dröge <slomo@circular-chaos.org>
* sys/directdraw/gstdirectdrawsink.c:
(gst_ddrawsurface_class_init), (gst_ddrawsurface_finalize),
(gst_directdraw_sink_finalize):
Properly chain up finalize functions. Fixes bug #515980.
2008-02-12 Sebastian Dröge <slomo@circular-chaos.org> 2008-02-12 Sebastian Dröge <slomo@circular-chaos.org>
* sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize), * sys/v4l2/v4l2src_calls.c: (gst_v4l2_buffer_finalize),

2
common

@ -1 +1 @@
Subproject commit 05a617c9043ddb78f8578195b18c166d7e1d4c2e Subproject commit 2a19465fdb43a75f4d32950fd2beb1beb950eec2

View file

@ -214,6 +214,7 @@ gst_directdraw_sink_init_interfaces (GType type)
/* Subclass of GstBuffer which manages buffer_pool surfaces lifetime */ /* Subclass of GstBuffer which manages buffer_pool surfaces lifetime */
static void gst_ddrawsurface_finalize (GstMiniObject * mini_object); static void gst_ddrawsurface_finalize (GstMiniObject * mini_object);
static GstBufferClass *ddrawsurface_parent_class = NULL;
static void static void
gst_ddrawsurface_init (GstDDrawSurface * surface, gpointer g_class) gst_ddrawsurface_init (GstDDrawSurface * surface, gpointer g_class)
@ -232,6 +233,8 @@ gst_ddrawsurface_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);
ddrawsurface_parent_class = g_type_class_peek_parent (g_class);
mini_object_class->finalize = GST_DEBUG_FUNCPTR (gst_ddrawsurface_finalize); mini_object_class->finalize = GST_DEBUG_FUNCPTR (gst_ddrawsurface_finalize);
} }
@ -283,7 +286,7 @@ gst_ddrawsurface_finalize (GstMiniObject * mini_object)
surface->width, surface->height, ddrawsink->video_width, surface->width, surface->height, ddrawsink->video_width,
ddrawsink->video_height); ddrawsink->video_height);
gst_directdraw_sink_surface_destroy (ddrawsink, surface); gst_directdraw_sink_surface_destroy (ddrawsink, surface);
GST_MINI_OBJECT_CLASS (ddrawsurface_parent_class)->finalize (mini_object);
} else { } else {
/* In that case we can reuse the image and add it to our image pool. */ /* In that case we can reuse the image and add it to our image pool. */
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink, GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
@ -296,10 +299,12 @@ gst_ddrawsurface_finalize (GstMiniObject * mini_object)
ddrawsink->buffer_pool = g_slist_prepend (ddrawsink->buffer_pool, surface); ddrawsink->buffer_pool = g_slist_prepend (ddrawsink->buffer_pool, surface);
g_mutex_unlock (ddrawsink->pool_lock); g_mutex_unlock (ddrawsink->pool_lock);
} }
return; return;
no_sink: no_sink:
GST_CAT_WARNING (directdrawsink_debug, "no sink found"); GST_CAT_WARNING (directdrawsink_debug, "no sink found");
GST_MINI_OBJECT_CLASS (ddrawsurface_parent_class)->finalize (mini_object);
return; return;
} }
@ -407,6 +412,8 @@ gst_directdraw_sink_finalize (GObject * object)
if (ddrawsink->setup) { if (ddrawsink->setup) {
gst_directdraw_sink_cleanup (ddrawsink); gst_directdraw_sink_cleanup (ddrawsink);
} }
G_OBJECT_CLASS (parent_class)->finalize (object);
} }
static void static void