diff options
author | Emmanuel Leblond <emmanuel.leblond@gmail.com> | 2022-06-12 00:18:08 +0200 |
---|---|---|
committer | Emmanuel Leblond <emmanuel.leblond@gmail.com> | 2022-06-12 00:18:08 +0200 |
commit | 228ce1d2b651e0e5b76521c4a0c055d997bb0c0d (patch) | |
tree | f8b433817289ae386dcf7c983d595057d0c06f1e /core | |
parent | 8df8fff54ba2263d53448b0a7f4e33fa76fdea50 (diff) |
Fix NativeExtension::open_library return value when the undelying lib fails to initialize
Diffstat (limited to 'core')
-rw-r--r-- | core/extension/native_extension.cpp | 9 |
1 files 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() { |