From cbb8e1acb28f9b9e72bb65f99aaf5d409f2d33f9 Mon Sep 17 00:00:00 2001 From: "SungBae, Park" Date: Fri, 25 Mar 2016 18:18:49 +0900 Subject: [PATCH] add check whether subsurface parent relationship is cycle Signed-off-by: SungBae, Park Change-Id: I3e48fa72830dce7b91902f958578c10ad894a35e --- src/bin/e_comp_wl.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 76c5d097c1..92ef9df3e8 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -3237,6 +3237,28 @@ e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl_ return EINA_FALSE; } + // check parent relationship is a cycle + { + E_Client *parent = epc; + + while(parent) + { + if (ec == parent) + { + ERR("Subsurface parent relationship is a cycle : [child win : %x, %s], [parent win : %x, %s]", + e_client_util_win_get(ec), e_client_util_name_get(ec), + e_client_util_win_get(epc), e_client_util_name_get(epc)); + + return EINA_FALSE; + } + + if (parent->comp_data->sub.data) + parent = parent->comp_data->sub.data->parent; + else + break; + } + } + /* try to allocate subsurface data */ if (!(sdata = E_NEW(E_Comp_Wl_Subsurf_Data, 1))) { -- 2.34.1