From: Changyeon Lee Date: Mon, 24 Oct 2016 04:21:25 +0000 (+0900) Subject: don't call reset callback when queue doesn't have attached buffer in flush X-Git-Tag: accepted/tizen/3.0/ivi/20161104.103618~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F93490%2F1;p=platform%2Fcore%2Fuifw%2Flibtbm.git don't call reset callback when queue doesn't have attached buffer in flush Change-Id: I2bccf23fc7b9569ea2e7aee26e06d0e73b0bd993 --- diff --git a/src/tbm_surface_queue.c b/src/tbm_surface_queue.c index 4279280..2b65e02 100644 --- a/src/tbm_surface_queue.c +++ b/src/tbm_surface_queue.c @@ -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);