-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
win32: simplify WNDPROC catch_unwind logic
Instead of wrapping each individual event dispatch in a call to AppState::catch_unwind, wrap the whole body of the WNDPROC in std::panic::catch_unwind and then use AppState::propagate_panic if a panic occurred. This reduces the number of WindowState::from_raw calls and simplifies the overall control flow of the WNDPROC. Also, use catch_unwind when dropping the Rc<WindowState> or Rc<AppState> at the end of the WNDPROC. Previously, if a panic occurred when dropping the Rc, it would have unwound across the FFI boundary.
- Loading branch information
Showing
2 changed files
with
168 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.