From 0ad1a8f3d00f1927765f7ad687a470f96373729a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 22 Jul 2017 16:11:04 -0300 Subject: [PATCH] Script languges are uninitialized properly now. --- core/script_language.cpp | 7 +++++++ core/script_language.h | 1 + main/main.cpp | 8 +++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/script_language.cpp b/core/script_language.cpp index 4a7fdc9d645..aeb15738409 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -99,6 +99,13 @@ void ScriptServer::init_languages() { } } +void ScriptServer::finish_languages() { + + for (int i = 0; i < _language_count; i++) { + _languages[i]->finish(); + } +} + void ScriptServer::set_reload_scripts_on_save(bool p_enable) { reload_scripts_on_save = p_enable; diff --git a/core/script_language.h b/core/script_language.h index a81300233f3..7aba3ec0f1f 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -69,6 +69,7 @@ public: static void thread_exit(); static void init_languages(); + static void finish_languages(); }; class ScriptInstance; diff --git a/main/main.cpp b/main/main.cpp index 5fef3658b92..8960d85c45b 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1697,14 +1697,16 @@ void Main::cleanup() { OS::get_singleton()->_execpath = ""; OS::get_singleton()->_local_clipboard = ""; - if (audio_server) { - memdelete(audio_server); - } + ScriptServer::finish_languages(); #ifdef TOOLS_ENABLED EditorNode::unregister_editor_types(); #endif + if (audio_server) { + memdelete(audio_server); + } + unregister_driver_types(); unregister_module_types(); unregister_scene_types();