don't call reset callback when queue doesn't have attached buffer in flush 90/93490/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 24 Oct 2016 04:21:25 +0000 (13:21 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 24 Oct 2016 04:21:33 +0000 (13:21 +0900)
Change-Id: I2bccf23fc7b9569ea2e7aee26e06d0e73b0bd993

src/tbm_surface_queue.c

index 4279280..2b65e02 100644 (file)
@@ -1392,10 +1392,15 @@ tbm_surface_queue_flush(tbm_surface_queue_h surface_queue)
        TBM_SURF_QUEUE_RETURN_VAL_IF_FAIL(_tbm_surface_queue_is_valid(surface_queue),
                               TBM_SURFACE_QUEUE_ERROR_INVALID_QUEUE);
 
-       pthread_mutex_lock(&surface_queue->lock);
-
        TBM_QUEUE_TRACE("tbm_surface_queue(%p)\n", surface_queue);
 
+       if (surface_queue->num_attached == 0) {
+               _tbm_surf_queue_mutex_unlock();
+               return TBM_SURFACE_QUEUE_ERROR_NONE;
+       }
+
+       pthread_mutex_lock(&surface_queue->lock);
+
        /* Destory surface and Push to free_queue */
        LIST_FOR_EACH_ENTRY_SAFE(node, tmp, &surface_queue->list, link) {
                _queue_delete_node(surface_queue, node);