mirror of
https://github.com/danbulant/cushy
synced 2026-06-17 13:31:07 +00:00
Fix when replacing an overlay
When an overlay handle dropped directly after pushing a new overlay, it was possible for new overlays to be popped off improperly, causing a subtraction overflow panic later.
This commit is contained in:
parent
abbf8d94d8
commit
44759d4812
1 changed files with 2 additions and 2 deletions
|
|
@ -721,8 +721,8 @@ impl Drop for OverlayHandle {
|
|||
return;
|
||||
};
|
||||
|
||||
while state.overlays.len() > index {
|
||||
let _removed = state.overlays.pop();
|
||||
while state.overlays.len() - state.new_overlays > index {
|
||||
let _removed = state.overlays.remove_by_index(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue