summaryrefslogtreecommitdiff
path: root/gst/audiovisualizers
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-02-16 23:54:28 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-02-17 09:56:55 +0000
commite9141b718b3f1c3af92898f2982e188ea42b746a (patch)
treeecb6a64768a746de854c752a675f1d0515ed6dc6 /gst/audiovisualizers
parent0fd6872f7d831c11e59d203695ff8d3c0d355b83 (diff)
downloadgstreamer-plugins-bad-e9141b718b3f1c3af92898f2982e188ea42b746a.tar.gz
audiovisualizer: don't use private GMutex implementation details
Don't use private GMutex implementation details to check whether it has been freed already or not. Just turn dispose function into finalize function which will only be called once, that way we can just clear the mutex unconditionally.
Diffstat (limited to 'gst/audiovisualizers')
-rw-r--r--gst/audiovisualizers/gstaudiovisualizer.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gst/audiovisualizers/gstaudiovisualizer.c b/gst/audiovisualizers/gstaudiovisualizer.c
index 9d5767a3b..035278707 100644
--- a/gst/audiovisualizers/gstaudiovisualizer.c
+++ b/gst/audiovisualizers/gstaudiovisualizer.c
@@ -63,7 +63,7 @@ static void gst_audio_visualizer_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_audio_visualizer_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
-static void gst_audio_visualizer_dispose (GObject * object);
+static void gst_audio_visualizer_finalize (GObject * object);
static gboolean gst_audio_visualizer_src_negotiate (GstAudioVisualizer * scope);
static gboolean gst_audio_visualizer_src_setcaps (GstAudioVisualizer *
@@ -548,7 +548,7 @@ gst_audio_visualizer_class_init (GstAudioVisualizerClass * klass)
gobject_class->set_property = gst_audio_visualizer_set_property;
gobject_class->get_property = gst_audio_visualizer_get_property;
- gobject_class->dispose = gst_audio_visualizer_dispose;
+ gobject_class->finalize = gst_audio_visualizer_finalize;
element_class->change_state =
GST_DEBUG_FUNCPTR (gst_audio_visualizer_change_state);
@@ -655,7 +655,7 @@ gst_audio_visualizer_get_property (GObject * object, guint prop_id,
}
static void
-gst_audio_visualizer_dispose (GObject * object)
+gst_audio_visualizer_finalize (GObject * object)
{
GstAudioVisualizer *scope = GST_AUDIO_VISUALIZER (object);
@@ -672,11 +672,10 @@ gst_audio_visualizer_dispose (GObject * object)
gst_buffer_unref (scope->tempbuf);
scope->tempbuf = NULL;
}
- if (scope->config_lock.p) {
- g_mutex_clear (&scope->config_lock);
- scope->config_lock.p = NULL;
- }
- G_OBJECT_CLASS (parent_class)->dispose (object);
+
+ g_mutex_clear (&scope->config_lock);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void