From bf046e0430374fd3b2850a16e7e772c34427697c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 14 Apr 2011 13:43:06 +0200 Subject: [PATCH] qtmoovrecover: Don't leak the static recursive mutex --- gst/quicktime/gstqtmoovrecover.c | 7 +++---- gst/quicktime/gstqtmoovrecover.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gst/quicktime/gstqtmoovrecover.c b/gst/quicktime/gstqtmoovrecover.c index 889b2cc4b5..68011dcd63 100644 --- a/gst/quicktime/gstqtmoovrecover.c +++ b/gst/quicktime/gstqtmoovrecover.c @@ -351,9 +351,8 @@ gst_qt_moov_recover_change_state (GstElement * element, switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: qtmr->task = gst_task_create (gst_qt_moov_recover_run, qtmr); - qtmr->task_mutex = g_new (GStaticRecMutex, 1); - g_static_rec_mutex_init (qtmr->task_mutex); - gst_task_set_lock (qtmr->task, qtmr->task_mutex); + g_static_rec_mutex_init (&qtmr->task_mutex); + gst_task_set_lock (qtmr->task, &qtmr->task_mutex); break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: gst_task_start (qtmr->task); @@ -373,7 +372,7 @@ gst_qt_moov_recover_change_state (GstElement * element, g_assert (gst_task_get_state (qtmr->task) == GST_TASK_STOPPED); gst_object_unref (qtmr->task); qtmr->task = NULL; - g_static_rec_mutex_free (qtmr->task_mutex); + g_static_rec_mutex_free (&qtmr->task_mutex); break; default: break; diff --git a/gst/quicktime/gstqtmoovrecover.h b/gst/quicktime/gstqtmoovrecover.h index 07dc9d9379..15eac847b8 100644 --- a/gst/quicktime/gstqtmoovrecover.h +++ b/gst/quicktime/gstqtmoovrecover.h @@ -66,7 +66,7 @@ struct _GstQTMoovRecover GstPipeline pipeline; GstTask *task; - GStaticRecMutex *task_mutex; + GStaticRecMutex task_mutex; /* properties */ gboolean faststart_mode;