summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-18 09:07:21 +0100
committerGitHub <noreply@github.com>2022-02-18 09:07:21 +0100
commitb4dc2e91e6143de6722aede77692fdacbfbe840c (patch)
tree44f63cf142ae4f8661c60ac121ac0f4bc9ae85ae
parent488116e4d8f12b78b44e4e9d83228e1598102d8a (diff)
parent94ef200bab8feb5024b2c64ac14daa24e0c4cc55 (diff)
Merge pull request #58196 from poiati/fix-extension-registration-order
-rw-r--r--core/register_core_types.cpp4
-rw-r--r--core/register_core_types.h1
-rw-r--r--main/main.cpp7
3 files changed, 8 insertions, 4 deletions
diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp
index a4b6a589f3..7ebffdb459 100644
--- a/core/register_core_types.cpp
+++ b/core/register_core_types.cpp
@@ -316,9 +316,11 @@ void register_core_extensions() {
native_extension_manager->initialize_extensions(NativeExtension::INITIALIZATION_LEVEL_CORE);
}
-void unregister_core_types() {
+void unregister_core_extensions() {
native_extension_manager->deinitialize_extensions(NativeExtension::INITIALIZATION_LEVEL_CORE);
+}
+void unregister_core_types() {
memdelete(native_extension_manager);
memdelete(resource_uid);
diff --git a/core/register_core_types.h b/core/register_core_types.h
index 0fd4e73c40..dfb2d8ac80 100644
--- a/core/register_core_types.h
+++ b/core/register_core_types.h
@@ -36,5 +36,6 @@ void register_core_settings();
void register_core_extensions();
void register_core_singletons();
void unregister_core_types();
+void unregister_core_extensions();
#endif // REGISTER_CORE_TYPES_H
diff --git a/main/main.cpp b/main/main.cpp
index 21199fe227..f8877d0717 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -487,6 +487,7 @@ void Main::test_cleanup() {
}
unregister_core_driver_types();
+ unregister_core_extensions();
unregister_core_types();
OS::get_singleton()->finalize_core();
@@ -554,6 +555,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
globals = memnew(ProjectSettings);
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);
performance = memnew(Performance);
@@ -634,7 +636,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
continue;
}
#endif
-
List<String>::Element *N = I->next();
if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help
@@ -1271,8 +1272,6 @@ 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"));
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,
// for the project manager, depending on how smooth the fallback is.
GLOBAL_DEF_RST("rendering/driver/driver_name", "vulkan");
@@ -1529,6 +1528,7 @@ error:
}
unregister_core_driver_types();
+ unregister_core_extensions();
unregister_core_types();
OS::get_singleton()->_cmdline.clear();
@@ -2888,6 +2888,7 @@ void Main::cleanup(bool p_force) {
memdelete(message_queue);
unregister_core_driver_types();
+ unregister_core_extensions();
unregister_core_types();
OS::get_singleton()->finalize_core();