Merge pull request #48081 from bruvzg/fix_api_gen_crash

Fix crash on GDNative API json generator exit.
This commit is contained in:
Rémi Verschelde 2021-04-22 09:46:43 +02:00 committed by GitHub
commit 77a876c6e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,8 @@
#include "core/os/file_access.h" #include "core/os/file_access.h"
#include "core/os/os.h" #include "core/os/os.h"
#include "main/main.h"
#include "scene/main/scene_tree.h" #include "scene/main/scene_tree.h"
#include "scene/resources/resource_format_text.h" #include "scene/resources/resource_format_text.h"
@ -1248,6 +1250,7 @@ void NativeScriptLanguage::init() {
if (generate_c_api(E->next()->get()) != OK) { if (generate_c_api(E->next()->get()) != OK) {
ERR_PRINT("Failed to generate C API\n"); ERR_PRINT("Failed to generate C API\n");
} }
Main::cleanup(true);
exit(0); exit(0);
} }
@ -1257,6 +1260,7 @@ void NativeScriptLanguage::init() {
if (generate_c_builtin_api(E->next()->get()) != OK) { if (generate_c_builtin_api(E->next()->get()) != OK) {
ERR_PRINT("Failed to generate C builtin API\n"); ERR_PRINT("Failed to generate C builtin API\n");
} }
Main::cleanup(true);
exit(0); exit(0);
} }
#endif #endif