From 58eb16464242f15e729676ae01a52b5f826dfa56 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Tue, 27 Apr 2010 10:59:00 +0300 Subject: [PATCH] jack: don't leak caps Add dispose methods to clear caps. --- ext/jack/gstjackaudiosink.c | 11 +++++++++++ ext/jack/gstjackaudiosrc.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/ext/jack/gstjackaudiosink.c b/ext/jack/gstjackaudiosink.c index 04c9d06..3b9df01 100644 --- a/ext/jack/gstjackaudiosink.c +++ b/ext/jack/gstjackaudiosink.c @@ -655,6 +655,7 @@ enum GST_BOILERPLATE_FULL (GstJackAudioSink, gst_jack_audio_sink, GstBaseAudioSink, GST_TYPE_BASE_AUDIO_SINK, _do_init); +static void gst_jack_audio_sink_dispose (GObject * object); static void gst_jack_audio_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_jack_audio_sink_get_property (GObject * object, guint prop_id, @@ -689,6 +690,7 @@ gst_jack_audio_sink_class_init (GstJackAudioSinkClass * klass) gstbasesink_class = (GstBaseSinkClass *) klass; gstbaseaudiosink_class = (GstBaseAudioSinkClass *) klass; + gobject_class->dispose = gst_jack_audio_sink_dispose; gobject_class->get_property = gst_jack_audio_sink_get_property; gobject_class->set_property = gst_jack_audio_sink_set_property; @@ -725,6 +727,15 @@ gst_jack_audio_sink_init (GstJackAudioSink * sink, } static void +gst_jack_audio_sink_dispose (GObject * object) +{ + GstJackAudioSink *sink = GST_JACK_AUDIO_SINK (object); + + gst_caps_replace (&sink->caps, NULL); + G_OBJECT_CLASS (parent_class)->dispose (object); +} + +static void gst_jack_audio_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { diff --git a/ext/jack/gstjackaudiosrc.c b/ext/jack/gstjackaudiosrc.c index 7520447..ee4ae8d 100644 --- a/ext/jack/gstjackaudiosrc.c +++ b/ext/jack/gstjackaudiosrc.c @@ -664,6 +664,7 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_BOILERPLATE_FULL (GstJackAudioSrc, gst_jack_audio_src, GstBaseAudioSrc, GST_TYPE_BASE_AUDIO_SRC, _do_init); +static void gst_jack_audio_src_dispose (GObject * object); static void gst_jack_audio_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_jack_audio_src_get_property (GObject * object, guint prop_id, @@ -703,6 +704,7 @@ gst_jack_audio_src_class_init (GstJackAudioSrcClass * klass) gstbasesrc_class = (GstBaseSrcClass *) klass; gstbaseaudiosrc_class = (GstBaseAudioSrcClass *) klass; + gobject_class->dispose = gst_jack_audio_src_dispose; gobject_class->set_property = gst_jack_audio_src_set_property; gobject_class->get_property = gst_jack_audio_src_get_property; @@ -743,6 +745,15 @@ gst_jack_audio_src_init (GstJackAudioSrc * src, GstJackAudioSrcClass * gclass) } static void +gst_jack_audio_src_dispose (GObject * object) +{ + GstJackAudioSrc *src = GST_JACK_AUDIO_SRC (object); + + gst_caps_replace (&src->caps, NULL); + G_OBJECT_CLASS (parent_class)->dispose (object); +} + +static void gst_jack_audio_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { -- 2.7.4