Skip to content

Commit

Permalink
runa-orbiter/shell: fix panic when destroying subsurface
Browse files Browse the repository at this point in the history
When subsurface role is deactivated, it might still be referenced by a
parent surface state. Therefore we need to keep track of that parent
state, _and_ we can't free this subsurface's surface state immediately.

Both of these are achieved by not clearing surface's current `role_state`
in `deactivate_role`.

Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Mar 10, 2024
1 parent 4123192 commit 780587d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion runa-orbiter/src/shell/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,6 @@ impl<S: Shell> Surface<S> {
if let Some(role) = self.role.borrow_mut().as_mut() {
if role.is_active() {
role.deactivate(shell);
shell.get_mut(self.current_key()).role_state = None;
self.pending_mut().role_state = None;
shell.role_deactivated(self.current_key(), role.name());
assert!(!role.is_active());
Expand Down

0 comments on commit 780587d

Please sign in to comment.