ソースを参照

Script languges are uninitialized properly now.

Juan Linietsky 8 年 前
コミット
0ad1a8f3d0
3 ファイル変更13 行追加3 行削除
  1. 7 0
      core/script_language.cpp
  2. 1 0
      core/script_language.h
  3. 5 3
      main/main.cpp

+ 7 - 0
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;

+ 1 - 0
core/script_language.h

@@ -69,6 +69,7 @@ public:
 	static void thread_exit();
 
 	static void init_languages();
+	static void finish_languages();
 };
 
 class ScriptInstance;

+ 5 - 3
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();