gst/gstdata.c: Adding a categorized debug on data_ref because data_unref has one and i prefer the debug to be symetric.

Original commit message from CVS:
2004-02-09  Julien MOUTTE  <julien@moutte.net>

* gst/gstdata.c: (gst_data_ref): Adding a categorized debug on data_ref
because data_unref has one and i prefer the debug to be symetric.
* gst/gstqueue.c: (gst_queue_locked_flush): Fix a huge memleak. Buffers
were refed when added to the queue and unrefed only once when the queue
was flushed. Now the flush handler unref the buffers two times : first
unref for the ref added when pushing in the queue's tail and second
unref to destroy the flushed buffer.
This commit is contained in:
Julien Moutte 2004-02-09 09:11:50 +00:00
parent 9558626b50
commit df6a979243
4 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,13 @@
2004-02-09 Julien MOUTTE <julien@moutte.net>
* gst/gstdata.c: (gst_data_ref): Adding a categorized debug on data_ref
because data_unref has one and i prefer the debug to be symetric.
* gst/gstqueue.c: (gst_queue_locked_flush): Fix a huge memleak. Buffers
were refed when added to the queue and unrefed only once when the queue
was flushed. Now the flush handler unref the buffers two times : first
unref for the ref added when pushing in the queue's tail and second
unref to destroy the flushed buffer.
2004-02-08 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/pwg/building-boiler.xml: fix cvs checkout documentation

View file

@ -187,6 +187,9 @@ gst_data_ref (GstData *data)
g_return_val_if_fail (data != NULL, NULL);
g_return_val_if_fail (GST_DATA_REFCOUNT_VALUE(data) > 0, NULL);
GST_CAT_LOG (GST_CAT_BUFFER, "ref data %p, count before ref is %d",
data, GST_DATA_REFCOUNT_VALUE (data));
gst_atomic_int_inc (&data->refcount);
return data;

View file

@ -361,6 +361,10 @@ gst_queue_locked_flush (GstQueue *queue)
{
while (!g_queue_is_empty (queue->queue)) {
GstData *data = g_queue_pop_head (queue->queue);
/* First loose the reference we added when putting that data in the queue */
gst_data_unref (data);
/* Then loose another reference because we are supposed to destroy that
data when flushing */
gst_data_unref (data);
}
queue->timeval = NULL;

View file

@ -361,6 +361,10 @@ gst_queue_locked_flush (GstQueue *queue)
{
while (!g_queue_is_empty (queue->queue)) {
GstData *data = g_queue_pop_head (queue->queue);
/* First loose the reference we added when putting that data in the queue */
gst_data_unref (data);
/* Then loose another reference because we are supposed to destroy that
data when flushing */
gst_data_unref (data);
}
queue->timeval = NULL;