wayland.compositor: fix leak of surface data

The subsurface logic holds a self-reference to the WlSurface to
track stacking orders of the children relative to the parent. This
self-reference needs be dropped during cleanup to avoid reference
cycles.

This was not the case, and caused every surface user data to be
leaked as it kept a reference to itself (and all of its children).
This commit is contained in:
Victor Berger 2021-09-28 16:02:58 +02:00 committed by Victor Berger
parent 70c11e6c62
commit 3842b78979
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ impl PrivateSurfaceData {
.retain(|c| !c.as_ref().equals(surface.as_ref())); .retain(|c| !c.as_ref().equals(surface.as_ref()));
} }
// orphan all our children // orphan all our children
for child in &my_data.children { for child in my_data.children.drain(..) {
let child_mutex = child let child_mutex = child
.as_ref() .as_ref()
.user_data() .user_data()