+2007-03-12 Tim-Philipp Müller <tim at centricular dot net>
+
+ * plugins/elements/gstmultiqueue.c: (gst_multi_queue_finalize),
+ (gst_single_queue_free):
+ Fix small leak (free GstSingleQueue structure too, not only contents).
+
2007-03-10 Sebastien Moutte <sebastien@moutte.net>
* gst/gstbin.c:(gst_bin_add):
};
static GstSingleQueue *gst_single_queue_new (GstMultiQueue * mqueue);
+static void gst_single_queue_free (GstSingleQueue * squeue);
static void wake_up_next_non_linked (GstMultiQueue * mq);
static void compute_next_non_linked (GstMultiQueue * mq);
gst_multi_queue_finalize (GObject * object)
{
GstMultiQueue *mqueue = GST_MULTI_QUEUE (object);
- GList *tmp = mqueue->queues;
- /* FILLME ? */
- /* DRAIN QUEUES */
- while (tmp) {
- GstSingleQueue *sq = (GstSingleQueue *) tmp->data;
-
- gst_data_queue_flush (sq->queue);
- g_object_unref (G_OBJECT (sq->queue));
-
- tmp = g_list_next (tmp);
- }
+ g_list_foreach (mqueue->queues, (GFunc) gst_single_queue_free, NULL);
g_list_free (mqueue->queues);
+ mqueue->queues = NULL;
/* free/unref instance data */
g_mutex_free (mqueue->qlock);
return res;
}
+static void
+gst_single_queue_free (GstSingleQueue * sq)
+{
+ /* DRAIN QUEUE */
+ gst_data_queue_flush (sq->queue);
+ g_object_unref (sq->queue);
+ g_free (sq);
+}
+
static GstSingleQueue *
gst_single_queue_new (GstMultiQueue * mqueue)
{