e_video_shell: Check surface role when destroy 20/320120/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Thu, 7 Nov 2024 10:39:27 +0000 (19:39 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 8 Nov 2024 02:47:05 +0000 (11:47 +0900)
Change-Id: I024e45149f4ca35d29da7cee8856128579db1f8f

src/bin/server/e_video_shell.c

index 327bb6940e9c323af8e5f5c88b0f20c6137c14a0..22cc8657d70f25aa44b4358fe55eeb9d30bd01b7 100644 (file)
@@ -1623,11 +1623,17 @@ _video_surface_destroy(E_Video_Surface *surface)
 {
    VS_INF("SURFACE %p| Destroy", surface);
 
-   if (surface->source)
-     _source_destroy(surface->source);
+   if (surface->role == E_VIDEO_SURFACE_ROLE_VIEWPORT_SOURCE)
+     {
+        if (surface->source)
+          _source_destroy(surface->source);
+     }
 
-   if (surface->subsurface)
-     wl_list_remove(&surface->subsurface_destroy.link);
+   if (surface->role == E_VIDEO_SURFACE_ROLE_SUBSURFACE)
+     {
+        if (surface->subsurface)
+          wl_list_remove(&surface->subsurface_destroy.link);
+     }
 
    wl_resource_set_user_data(surface->resource, NULL);
    wl_list_remove(&surface->surface_destroy.link);