From: Seunghun Lee Date: Fri, 28 Apr 2023 05:06:33 +0000 (+0900) Subject: subsurface: Destroy after destruction of parent surface X-Git-Tag: accepted/tizen/unified/20230720.164642~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98ebe2feee9e2c475bcfba9a98e86d2108b98fcd;p=platform%2Fcore%2Fuifw%2Flibds.git 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 --- 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;