Release the offset borrow before bring_window_to reloads the window
Holding D in develop across the edge of the loaded window panicked with "RefCell already borrowed" at the first step that had to move it. The `*ctl.offset.borrow()` written inside the `if let` condition is a temporary that lives to the end of the `if let` block (edition 2021), and the block calls `load_window`, which borrows the offset mutably. The unit tests drive the placement arithmetic, not the RefCells, so they could not see it; stepping 400 frames in the app did. The offset is copied out before the test. `follow_open` gets the same treatment for `image_ids`: the lookup's result is bound first, so no borrow is held while it writes properties back to the window.
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user