subsurface: Destroy after destruction of parent surface 41/294241/1
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 28 Apr 2023 05:06:33 +0000 (14:06 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 15 Jun 2023 01:53:42 +0000 (10:53 +0900)
A subsurface will be destroyed after its parent surface because the
subsurface becomes inert when its parent is destroyed.
Thus, we can make sure that a subsurface always has a valid parent.

Change-Id: I50ac03e9e3e7bd4373a2f028d89697d597016889

src/compositor/subsurface.c

index d21a2a4..b3bc455 100644 (file)
@@ -318,7 +318,7 @@ subsurface_handle_parent_destroy(struct wl_listener *listener,
 
     subsurface = wl_container_of(listener, subsurface,
             listener.parent_destroy);
-    subsurface_unlink_parent(subsurface);
+    subsurface_destroy(subsurface);
 }
 
 static void
@@ -390,9 +390,6 @@ subsurface_is_synchronized(struct ds_subsurface *subsurface)
     do {
         if (iter->synchronized)
             return true;
-
-        if (!iter->parent)
-            break;
     } while ((iter = subsurface_from_ds_surface(iter->parent)));
 
     return false;