From 228ce1d2b651e0e5b76521c4a0c055d997bb0c0d Mon Sep 17 00:00:00 2001 From: Emmanuel Leblond Date: Sun, 12 Jun 2022 00:18:08 +0200 Subject: Fix NativeExtension::open_library return value when the undelying lib fails to initialize --- core/extension/native_extension.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp index 5738b42049..ac9d2ca8a6 100644 --- a/core/extension/native_extension.cpp +++ b/core/extension/native_extension.cpp @@ -295,9 +295,12 @@ Error NativeExtension::open_library(const String &p_path, const String &p_entry_ GDNativeInitializationFunction initialization_function = (GDNativeInitializationFunction)entry_funcptr; - initialization_function(&gdnative_interface, this, &initialization); - level_initialized = -1; - return OK; + if (initialization_function(&gdnative_interface, this, &initialization)) { + level_initialized = -1; + return OK; + } else { + return FAILED; + } } void NativeExtension::close_library() { -- cgit v1.2.3