From 575433b997c31143ad0fa4f9586c7ddf7203ab1c 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: [PATCH] Fix crash on GDNative API json generator exit. (cherry picked from commit a4423c82f87ad0eaa9ffc3842407d003321ac22d) --- modules/gdnative/nativescript/nativescript.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index cc46a1fff30..2a1a3af7818 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -39,6 +39,8 @@ #include "core/os/os.h" #include "core/project_settings.h" +#include "main/main.h" + #include "scene/main/scene_tree.h" #include "scene/resources/resource_format_text.h" @@ -1055,6 +1057,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); } #endif