From 98ebe2feee9e2c475bcfba9a98e86d2108b98fcd Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Fri, 28 Apr 2023 14:06:33 +0900 Subject: [PATCH] subsurface: Destroy after destruction of parent surface 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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/compositor/subsurface.c b/src/compositor/subsurface.c index d21a2a4..b3bc455 100644 --- a/src/compositor/subsurface.c +++ b/src/compositor/subsurface.c @@ -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; -- 2.7.4