queue2: fix minor memory leak

This commit is contained in:
Tim-Philipp Müller 2011-04-07 19:44:44 +01:00
parent 01d016e720
commit 419d117851

View file

@ -2796,7 +2796,7 @@ gst_queue2_src_activate_pull (GstPad * pad, gboolean active)
result = gst_queue2_open_temp_location_file (queue); result = gst_queue2_open_temp_location_file (queue);
} else if (!queue->ring_buffer) { } else if (!queue->ring_buffer) {
queue->ring_buffer = g_malloc (queue->ring_buffer_max_size); queue->ring_buffer = g_malloc (queue->ring_buffer_max_size);
result = !!queue->ring_buffer; result = ! !queue->ring_buffer;
} else { } else {
result = TRUE; result = TRUE;
} }
@ -2891,6 +2891,7 @@ gst_queue2_change_state (GstElement * element, GstStateChange transition)
g_free (queue->ring_buffer); g_free (queue->ring_buffer);
queue->ring_buffer = NULL; queue->ring_buffer = NULL;
} }
clean_ranges (queue);
} }
if (queue->starting_segment != NULL) { if (queue->starting_segment != NULL) {
gst_event_unref (queue->starting_segment); gst_event_unref (queue->starting_segment);