Merge pull request #61949 from touilleMan/native_extension_open_library_handle_initialization_error

Fix NativeExtension::open_library return value when the undelying lib fails to initialize
This commit is contained in:
Rémi Verschelde 2022-06-12 08:49:19 +02:00 committed by GitHub
commit d4235f51b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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() {