Merge pull request #118771 from NoctemCat/web_remove_ub_at_exit

[Web] Remove undefined behavior around exit
This commit is contained in:
Thaddeus Crews
2026-06-16 19:12:42 -05:00
committed by GitHub
+2 -1
View File
@@ -67,9 +67,10 @@ void exit_callback() {
main_started = false;
}
int exit_code = OS_Web::get_singleton()->get_exit_code();
memdelete(os);
delete os; // We used a normal new, so it needs a normal delete.
os = nullptr;
godot_cleanup_profiler();
emscripten_cancel_main_loop(); // We are exiting in this iteration.
emscripten_force_exit(exit_code); // Exit runtime.
}