Move assert checking to before add listener of wl_buffer 22/263522/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Mon, 6 Sep 2021 02:04:23 +0000 (11:04 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Mon, 6 Sep 2021 02:04:23 +0000 (11:04 +0900)
Change-Id: Ia1b6a7ed497b5f0f1d2201719a40a3d1291acff0
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wl_egl_thread.c

index cf6ba5e..926f669 100755 (executable)
@@ -2792,9 +2792,9 @@ _thread_surface_queue_acquire(tpl_wl_egl_surface_t *wl_egl_surface)
                                        !wl_egl_surface->surface_sync)
 #endif
                                {
-                                               wl_buffer_add_listener((struct wl_buffer *)wl_egl_buffer->wl_buffer,
-                                                                                          &wl_buffer_release_listener,
-                                                                                          wl_egl_buffer);
+                                       wl_buffer_add_listener((struct wl_buffer *)wl_egl_buffer->wl_buffer,
+                                                                                  &wl_buffer_release_listener,
+                                                                                  wl_egl_buffer);
                                }
                        }
                }
@@ -3184,11 +3184,15 @@ _thread_wl_surface_commit(tpl_wl_egl_surface_t *wl_egl_surface,
                        (struct wl_proxy *)wayland_tbm_client_create_buffer(
                                                wl_egl_display->wl_tbm_client,
                                                wl_egl_buffer->tbm_surface);
+
+               TPL_CHECK_ON_FALSE_ASSERT_FAIL(wl_egl_buffer->wl_buffer != NULL,
+                                                                          "[FATAL] Failed to create wl_buffer");
+
                TPL_INFO("[WL_BUFFER_CREATE]",
                                 "wl_egl_buffer(%p) wl_buffer(%p) tbm_surface(%p)",
                                 wl_egl_buffer, wl_egl_buffer->wl_buffer,
                                 wl_egl_buffer->tbm_surface);
-
+               
 #if TIZEN_FEATURE_ENABLE
                if (!wl_egl_display->use_explicit_sync ||
                        !wl_egl_surface->surface_sync)
@@ -3199,8 +3203,6 @@ _thread_wl_surface_commit(tpl_wl_egl_surface_t *wl_egl_surface,
                                                                   wl_egl_buffer);
                }
        }
-       TPL_CHECK_ON_FALSE_ASSERT_FAIL(wl_egl_buffer->wl_buffer != NULL,
-                                                                  "[FATAL] Failed to create wl_buffer");
 
        version = wl_proxy_get_version((struct wl_proxy *)wl_surface);