androidcamera: Fix memleak and lose of buffer if the data queue is flushing

This commit is contained in:
Youness Alaoui 2012-10-30 10:12:06 -04:00 committed by Nicolas Dufresne
parent 122083eadb
commit 0552bb1b2a

View file

@ -571,7 +571,10 @@ gst_ahc_src_on_preview_frame (jbyteArray array, gpointer user_data)
item->visible = TRUE;
item->destroy = (GDestroyNotify) _data_queue_item_free;
gst_data_queue_push (self->queue, item);
if (!gst_data_queue_push (self->queue, item)) {
/* Can't add buffer to queue. Must be flushing. */
_data_queue_item_free (item);
}
}
static void