mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
sys/: Correctly chain up finalize with the parent class to prevent memory leaks. Fixes #474880.
Original commit message from CVS: Patch by: René Stadler <mail at renestadler dot de> * sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize), (gst_ximage_buffer_class_init): * sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy), (gst_xvimage_buffer_class_init): Correctly chain up finalize with the parent class to prevent memory leaks. Fixes #474880.
This commit is contained in:
parent
6fa7788c5d
commit
a011ad5aee
3 changed files with 25 additions and 0 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2007-09-09 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
|
Patch by: René Stadler <mail at renestadler dot de>
|
||||||
|
|
||||||
|
* sys/ximage/ximagesink.c: (gst_ximage_buffer_finalize),
|
||||||
|
(gst_ximage_buffer_class_init):
|
||||||
|
* sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_destroy),
|
||||||
|
(gst_xvimage_buffer_class_init):
|
||||||
|
Correctly chain up finalize with the parent class to prevent
|
||||||
|
memory leaks. Fixes #474880.
|
||||||
|
|
||||||
2007-09-09 Sebastian Dröge <slomo@circular-chaos.org>
|
2007-09-09 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* gst/volume/gstvolume.c: (volume_choose_func):
|
* gst/volume/gstvolume.c: (volume_choose_func):
|
||||||
|
|
|
@ -180,6 +180,8 @@ static GstVideoSinkClass *parent_class = NULL;
|
||||||
|
|
||||||
/* ximage buffers */
|
/* ximage buffers */
|
||||||
|
|
||||||
|
static GstBufferClass *ximage_buffer_parent_class = NULL;
|
||||||
|
|
||||||
#define GST_TYPE_XIMAGE_BUFFER (gst_ximage_buffer_get_type())
|
#define GST_TYPE_XIMAGE_BUFFER (gst_ximage_buffer_get_type())
|
||||||
|
|
||||||
#define GST_IS_XIMAGE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XIMAGE_BUFFER))
|
#define GST_IS_XIMAGE_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XIMAGE_BUFFER))
|
||||||
|
@ -236,6 +238,10 @@ gst_ximage_buffer_finalize (GstXImageBuffer * ximage)
|
||||||
recycled = TRUE;
|
recycled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!recycled)
|
||||||
|
GST_MINI_OBJECT_CLASS (ximage_buffer_parent_class)->
|
||||||
|
finalize (GST_MINI_OBJECT (ximage));
|
||||||
|
|
||||||
beach:
|
beach:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -263,6 +269,8 @@ gst_ximage_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);
|
||||||
|
|
||||||
|
ximage_buffer_parent_class = g_type_class_peek_parent (g_class);
|
||||||
|
|
||||||
mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
|
mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
|
||||||
gst_ximage_buffer_finalize;
|
gst_ximage_buffer_finalize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,7 @@ MotifWmHints, MwmHints;
|
||||||
|
|
||||||
static void gst_xvimagesink_reset (GstXvImageSink * xvimagesink);
|
static void gst_xvimagesink_reset (GstXvImageSink * xvimagesink);
|
||||||
|
|
||||||
|
static GstBufferClass *xvimage_buffer_parent_class = NULL;
|
||||||
static void gst_xvimage_buffer_finalize (GstXvImageBuffer * xvimage);
|
static void gst_xvimage_buffer_finalize (GstXvImageBuffer * xvimage);
|
||||||
|
|
||||||
static void gst_xvimagesink_xwindow_update_geometry (GstXvImageSink *
|
static void gst_xvimagesink_xwindow_update_geometry (GstXvImageSink *
|
||||||
|
@ -281,6 +282,9 @@ beach:
|
||||||
xvimage->xvimagesink = NULL;
|
xvimage->xvimagesink = NULL;
|
||||||
gst_object_unref (xvimagesink);
|
gst_object_unref (xvimagesink);
|
||||||
|
|
||||||
|
GST_MINI_OBJECT_CLASS (xvimage_buffer_parent_class)->
|
||||||
|
finalize (GST_MINI_OBJECT (xvimage));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
no_sink:
|
no_sink:
|
||||||
|
@ -359,6 +363,8 @@ gst_xvimage_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);
|
||||||
|
|
||||||
|
xvimage_buffer_parent_class = g_type_class_peek_parent (g_class);
|
||||||
|
|
||||||
mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
|
mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
|
||||||
gst_xvimage_buffer_finalize;
|
gst_xvimage_buffer_finalize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue