Skip to content

Commit

Permalink
Merge pull request #92060 from raulsntos/core/memdelete-engine-later
Browse files Browse the repository at this point in the history
Release Engine after unregistering GDExtensions
  • Loading branch information
akien-mga committed May 18, 2024
2 parents 337e5da + e516479 commit 7437b9a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4295,9 +4295,6 @@ void Main::cleanup(bool p_force) {
if (globals) {
memdelete(globals);
}
if (engine) {
memdelete(engine);
}

if (OS::get_singleton()->is_restart_on_exit_set()) {
//attempt to restart with arguments
Expand All @@ -4315,6 +4312,10 @@ void Main::cleanup(bool p_force) {
uninitialize_modules(MODULE_INITIALIZATION_LEVEL_CORE);
unregister_core_types();

if (engine) {
memdelete(engine);
}

OS::get_singleton()->benchmark_end_measure("Shutdown", "Total");
OS::get_singleton()->benchmark_dump();

Expand Down

0 comments on commit 7437b9a

Please sign in to comment.