wayland: fix deadlock in SurfaceData::cleanup (#166)
This commit is contained in:
parent
a60e1cd7fd
commit
e42ccc8aee
|
@ -74,11 +74,12 @@ where
|
||||||
}
|
}
|
||||||
// orphan all our children
|
// orphan all our children
|
||||||
for child in &my_data.children {
|
for child in &my_data.children {
|
||||||
// don't do anything if this child is ourselves
|
let child_mutex = child.as_ref().user_data::<Mutex<SurfaceData<R>>>().unwrap();
|
||||||
if child.as_ref().equals(surface.as_ref()) {
|
if std::ptr::eq(child_mutex, my_data_mutex) {
|
||||||
|
// This child is ourselves, don't do anything.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let child_mutex = child.as_ref().user_data::<Mutex<SurfaceData<R>>>().unwrap();
|
|
||||||
let mut child_guard = child_mutex.lock().unwrap();
|
let mut child_guard = child_mutex.lock().unwrap();
|
||||||
child_guard.parent = None;
|
child_guard.parent = None;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue