[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
2 changed files with 4 additions and 0 deletions

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