destory mutex lock when surface destory and before free surface queue 51/55151/1 accepted/tizen/mobile/20151222.223757 accepted/tizen/tv/20151222.223814 accepted/tizen/wearable/20151222.223836 submit/tizen/20151222.081710
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 22 Dec 2015 07:41:59 +0000 (16:41 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 22 Dec 2015 08:15:18 +0000 (17:15 +0900)
Change-Id: I97e163ff7e5826fad15c01ac7ecde11c6ff12ade
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
src/tbm_surface_queue.c

index 4cfbbd3766e668d238ec1955b88d1fb58a83ddc7..5757a33c61a506aff0fabb481fe55ec1f1c955af 100644 (file)
@@ -356,8 +356,8 @@ tbm_surface_queue_h tbm_surface_queue_create(int queue_size, int width, int heig
        surface_queue->node_list = (queue_node **) calloc(queue_size, sizeof(queue_node *));
        if (!surface_queue->node_list) {
                TBM_LOG("surface node list alloc failed");
-               free(surface_queue);
                pthread_mutex_destroy(&surface_queue->lock);
+               free(surface_queue);
                return NULL;
        }
 
@@ -401,6 +401,7 @@ void tbm_surface_queue_destroy(tbm_surface_queue_h surface_queue)
                _queue_node_delete(surface_queue->node_list[i]);
 
        free(surface_queue->node_list);
+       pthread_mutex_destroy(&surface_queue->lock);
        free(surface_queue);
 }