Skip to content

Commit eb87eef

Browse files
committed
anvil: fix layer surface fifo deadlock
1 parent c3f3ac8 commit eb87eef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

anvil/src/state.rs

+6
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,9 @@ impl<BackendData: Backend + 'static> AnvilState<BackendData> {
819819
}
820820
});
821821
}
822+
// Drop the lock to the layer map before calling blocker_cleared, which might end up
823+
// calling the commit handler which in turn again could access the layer map.
824+
std::mem::drop(map);
822825

823826
if let CursorImageStatus::Surface(ref surface) = self.cursor_status {
824827
with_surfaces_surface_tree(surface, |surface, states| {
@@ -978,6 +981,9 @@ impl<BackendData: Backend + 'static> AnvilState<BackendData> {
978981
});
979982
}
980983
}
984+
// Drop the lock to the layer map before calling blocker_cleared, which might end up
985+
// calling the commit handler which in turn again could access the layer map.
986+
std::mem::drop(map);
981987

982988
if let CursorImageStatus::Surface(ref surface) = self.cursor_status {
983989
with_surfaces_surface_tree(surface, |surface, states| {

0 commit comments

Comments
 (0)