Fix crash during subsurface destruction

* subcompositor.c (ViewUnparent): Don't consider view as
attached if there is no subcompositor.
This commit is contained in:
hujianwei 2022-10-30 02:35:48 +00:00
parent 6f3941866a
commit b8d26761c1

View file

@ -1113,7 +1113,7 @@ ViewUnparent (View *child)
attached = (ViewVisibilityState (child, &mapped) attached = (ViewVisibilityState (child, &mapped)
&& mapped); && mapped);
if (attached) if (attached && child->subcompositor)
{ {
/* Init the damage region. */ /* Init the damage region. */
pixman_region32_init (&damage); pixman_region32_init (&damage);
@ -1178,7 +1178,7 @@ ViewUnparent (View *child)
#endif #endif
} }
if (attached) if (attached && child->subcompositor)
/* Finalize the damage region. */ /* Finalize the damage region. */
pixman_region32_fini (&damage); pixman_region32_fini (&damage);
} }