Remove unsafe null references

This commit is contained in:
John-Mark Allen 2021-06-21 22:40:31 +01:00 committed by Jack Spira
parent 80dcbe0d30
commit 4df9d1e336
2 changed files with 2 additions and 6 deletions

View File

@ -52,9 +52,7 @@ fn main() {
}
let ui = imgui_context.frame();
// Safety: internally, this reference just gets passed as a
// pointer to imgui, which handles the null pointer properly.
ui.show_demo_window(unsafe { &mut *std::ptr::null_mut() });
ui.show_demo_window(&mut true);
winit_platform.prepare_render(&ui, window.window());
let draw_data = ui.render();

View File

@ -47,9 +47,7 @@ fn main() {
tri_renderer.render(&gl);
let ui = imgui_context.frame();
// Safety: internally, this reference just gets passed as a
// pointer to imgui, which handles the null pointer properly.
ui.show_demo_window(unsafe { &mut *std::ptr::null_mut() });
ui.show_demo_window(&mut true);
winit_platform.prepare_render(&ui, window.window());
let draw_data = ui.render();