Merge pull request #58276 from akien-mga/revert-58196

This commit is contained in:
Rémi Verschelde 2022-02-18 15:06:30 +01:00 committed by GitHub
commit 0c18d0b9f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View file

@ -316,11 +316,9 @@ void register_core_extensions() {
native_extension_manager->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_CORE); native_extension_manager->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_CORE);
} }
void unregister_core_extensions() {
native_extension_manager->deinitialize_extensions(NativeExtension::INITIALIZATION_LEVEL_CORE);
}
void unregister_core_types() { void unregister_core_types() {
native_extension_manager->deinitialize_extensions(NativeExtension::INITIALIZATION_LEVEL_CORE);
memdelete(native_extension_manager); memdelete(native_extension_manager);
memdelete(resource_uid); memdelete(resource_uid);

View file

@ -36,6 +36,5 @@ void register_core_settings();
void register_core_extensions(); void register_core_extensions();
void register_core_singletons(); void register_core_singletons();
void unregister_core_types(); void unregister_core_types();
void unregister_core_extensions();
#endif // REGISTER_CORE_TYPES_H #endif // REGISTER_CORE_TYPES_H

View file

@ -487,7 +487,6 @@ void Main::test_cleanup() {
} }
unregister_core_driver_types(); unregister_core_driver_types();
unregister_core_extensions();
unregister_core_types(); unregister_core_types();
OS::get_singleton()->finalize_core(); OS::get_singleton()->finalize_core();
@ -555,7 +554,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
globals = memnew(ProjectSettings); globals = memnew(ProjectSettings);
register_core_settings(); //here globals are present register_core_settings(); //here globals are present
register_core_extensions(); // core extensions must be registered after core settings and before display
translation_server = memnew(TranslationServer); translation_server = memnew(TranslationServer);
performance = memnew(Performance); performance = memnew(Performance);
@ -636,6 +634,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
continue; continue;
} }
#endif #endif
List<String>::Element *N = I->next(); List<String>::Element *N = I->next();
if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help
@ -1272,6 +1271,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
Logger::set_flush_stdout_on_print(ProjectSettings::get_singleton()->get("application/run/flush_stdout_on_print")); Logger::set_flush_stdout_on_print(ProjectSettings::get_singleton()->get("application/run/flush_stdout_on_print"));
OS::get_singleton()->set_cmdline(execpath, main_args); OS::get_singleton()->set_cmdline(execpath, main_args);
register_core_extensions(); //before display
// possibly be worth changing the default from vulkan to something lower spec, // possibly be worth changing the default from vulkan to something lower spec,
// for the project manager, depending on how smooth the fallback is. // for the project manager, depending on how smooth the fallback is.
GLOBAL_DEF_RST("rendering/driver/driver_name", "vulkan"); GLOBAL_DEF_RST("rendering/driver/driver_name", "vulkan");
@ -1528,7 +1529,6 @@ error:
} }
unregister_core_driver_types(); unregister_core_driver_types();
unregister_core_extensions();
unregister_core_types(); unregister_core_types();
OS::get_singleton()->_cmdline.clear(); OS::get_singleton()->_cmdline.clear();
@ -2888,7 +2888,6 @@ void Main::cleanup(bool p_force) {
memdelete(message_queue); memdelete(message_queue);
unregister_core_driver_types(); unregister_core_driver_types();
unregister_core_extensions();
unregister_core_types(); unregister_core_types();
OS::get_singleton()->finalize_core(); OS::get_singleton()->finalize_core();