video_shell: Clarify if statement 79/320479/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 25 Feb 2025 07:43:13 +0000 (16:43 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 4 Mar 2025 06:55:59 +0000 (15:55 +0900)
The source and subsurface of surface must not be null as long as the
role is assigned to surface.

Change-Id: I1a822fb0becf01546fdeba1a266add5a721dd5ea

src/bin/server/e_video_shell.c

index 4f17e8182b0deff4083e45a614ada177157d988a..b7cfb583f436a6212078af0b946373e03ea7cd5d 100644 (file)
@@ -1602,16 +1602,9 @@ _video_surface_destroy(E_Video_Surface *surface)
    VS_INF("SURFACE %p| Destroy", surface);
 
    if (surface->role == E_VIDEO_SURFACE_ROLE_VIEWPORT_SOURCE)
-     {
-        if (surface->source)
-          _source_destroy(surface->source);
-     }
-
-   if (surface->role == E_VIDEO_SURFACE_ROLE_SUBSURFACE)
-     {
-        if (surface->subsurface)
-          wl_list_remove(&surface->subsurface_destroy.link);
-     }
+     _source_destroy(surface->source);
+   else if (surface->role == E_VIDEO_SURFACE_ROLE_SUBSURFACE)
+     wl_list_remove(&surface->subsurface_destroy.link);
 
    wl_resource_set_user_data(surface->resource, NULL);
    wl_list_remove(&surface->surface_destroy.link);