e_hwc_window_queue: move checking null before dequeue buffer 67/197567/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 14 Jan 2019 06:40:36 +0000 (15:40 +0900)
committerchangyeon lee <cyeon.lee@samsung.com>
Mon, 14 Jan 2019 10:21:05 +0000 (10:21 +0000)
Change-Id: Ib3ae14b5ca648c0832831656e5b663cebebaafb9

src/bin/e_hwc_window_queue.c

index 84b227efbfb2db42ed3826fa38ea52b7866e6bb5..c6b027abd4ec6770f827e3687e321e59e56b1217 100644 (file)
@@ -452,12 +452,15 @@ _e_hwc_window_queue_buffer_send(E_Hwc_Window_Queue *queue)
 
    if (!tbm_surface_queue_can_dequeue(queue->tqueue, 0)) return EINA_FALSE;
 
-   queue_buffer = e_hwc_window_queue_buffer_dequeue(queue);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(queue_buffer, EINA_FALSE);
-
    hwc_window = queue->user;
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
 
+   cqueue = _user_cqueue_get(hwc_window->ec);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(cqueue, EINA_FALSE);
+
+   queue_buffer = e_hwc_window_queue_buffer_dequeue(queue);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(queue_buffer, EINA_FALSE);
+
    if (queue_buffer->usable) return EINA_TRUE;
 
    if (!queue_buffer->exported || !queue_buffer->exported_wl_buffer)
@@ -466,9 +469,6 @@ _e_hwc_window_queue_buffer_send(E_Hwc_Window_Queue *queue)
         return EINA_FALSE;
      }
 
-   cqueue = _user_cqueue_get(hwc_window->ec);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(cqueue, EINA_FALSE);
-
    /* send the buffer_usable to the wl_tbm client */
    wayland_tbm_server_client_queue_send_buffer_usable(cqueue, queue_buffer->exported_wl_buffer);
    queue_buffer->usable = EINA_TRUE;