[0.11] gst-plugins-good: jack: don' t leak client name when freeing the element

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 05:33:00 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: 2e078fa556018c5c2f3c13d54aa6614622e5ecac
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=2e078fa556018c5c2f3c13d54aa6614622e5ecac

Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Fri Dec  9 15:50:28 2011 +0000

jack: don't leak client name when freeing the element

And add gtk-doc chunks for the new property.

https://bugzilla.gnome.org/show_bug.cgi?id=665872

---

 ext/jack/gstjackaudiosink.c |   13 +++++++++++++
 ext/jack/gstjackaudiosrc.c  |   13 +++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/ext/jack/gstjackaudiosink.c b/ext/jack/gstjackaudiosink.c
index e1513b7..078ca24 100644
--- a/ext/jack/gstjackaudiosink.c
+++ b/ext/jack/gstjackaudiosink.c
@@ -717,6 +717,13 @@ gst_jack_audio_sink_class_init (GstJackAudioSinkClass * klass)
           "The Jack server to connect to (NULL = default)",
           DEFAULT_PROP_SERVER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  /**
+   * GstJackAudioSink:client-name
+   *
+   * The client name to use.
+   *
+   * Since: 0.10.31
+   */
   g_object_class_install_property (gobject_class, PROP_CLIENT_NAME,
       g_param_spec_string ("client-name", "Client name",
           "The client name of the Jack instance (NULL = default)",
@@ -760,6 +767,12 @@ gst_jack_audio_sink_dispose (GObject * object)
   GstJackAudioSink *sink = GST_JACK_AUDIO_SINK (object);
 
   gst_caps_replace (&sink->caps, NULL);
+
+  if (sink->client_name != NULL) {
+    g_free (sink->client_name);
+    sink->client_name = NULL;
+  }
+
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 
diff --git a/ext/jack/gstjackaudiosrc.c b/ext/jack/gstjackaudiosrc.c
index 469737d..3c37970 100644
--- a/ext/jack/gstjackaudiosrc.c
+++ b/ext/jack/gstjackaudiosrc.c
@@ -737,6 +737,13 @@ gst_jack_audio_src_class_init (GstJackAudioSrcClass * klass)
           "The Jack server to connect to (NULL = default)",
           DEFAULT_PROP_SERVER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  /**
+   * GstJackAudioSrc:client-name
+   *
+   * The client name to use.
+   *
+   * Since: 0.10.31
+   */
   g_object_class_install_property (gobject_class, PROP_CLIENT_NAME,
       g_param_spec_string ("client-name", "Client name",
           "The client name of the Jack instance (NULL = default)",
@@ -784,6 +791,12 @@ gst_jack_audio_src_dispose (GObject * object)
   GstJackAudioSrc *src = GST_JACK_AUDIO_SRC (object);
 
   gst_caps_replace (&src->caps, NULL);
+
+  if (src->client_name != NULL) {
+    g_free (src->client_name);
+    src->client_name = NULL;
+  }
+
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }
 



More information about the gstreamer-commits mailing list