[Windows] Fix use after free during window destruction (#1746)

This commit is contained in:
qthree 2020-10-24 00:04:18 +07:00 committed by GitHub
parent 8aa1be8336
commit 66c117e599
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -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)

View file

@ -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