From a4423c82f87ad0eaa9ffc3842407d003321ac22d Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 22 Apr 2021 10:24:04 +0300 Subject: Fix crash on GDNative API json generator exit. --- modules/gdnative/nativescript/nativescript.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index f795bef59f..3283f28de5 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -41,6 +41,8 @@ #include "core/os/file_access.h" #include "core/os/os.h" +#include "main/main.h" + #include "scene/main/scene_tree.h" #include "scene/resources/resource_format_text.h" @@ -1248,6 +1250,7 @@ void NativeScriptLanguage::init() { if (generate_c_api(E->next()->get()) != OK) { ERR_PRINT("Failed to generate C API\n"); } + Main::cleanup(true); exit(0); } @@ -1257,6 +1260,7 @@ void NativeScriptLanguage::init() { if (generate_c_builtin_api(E->next()->get()) != OK) { ERR_PRINT("Failed to generate C builtin API\n"); } + Main::cleanup(true); exit(0); } #endif -- cgit v1.2.3