Skip to content

Commit

Permalink
[Windows] Fix use after free during window destruction (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
qthree authored Oct 23, 2020
1 parent 8aa1be8 commit 66c117e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- **Breaking:** On Windows, include prefix byte in scancodes.
- On Wayland, fix window not being resizeable when using `with_min_inner_size` in `WindowBuilder`.
- On Unix, fix cross-compiling to wasm32 without enabling X11 or Wayland.
- On Windows, fix use after free crash during window destruction.

# 0.23.0 (2020-10-02)

Expand Down
3 changes: 3 additions & 0 deletions src/platform_impl/windows/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,10 @@ unsafe extern "system" fn public_window_callback<T: 'static>(
event: Destroyed,
});
subclass_input.event_loop_runner.remove_window(window);
0
}

winuser::WM_NCDESTROY => {
drop(subclass_input);
Box::from_raw(subclass_input_ptr as *mut SubclassInput<T>);
0
Expand Down

0 comments on commit 66c117e

Please sign in to comment.