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:
commit
d4235f51b1
1 changed files with 6 additions and 3 deletions
|
@ -295,9 +295,12 @@ Error NativeExtension::open_library(const String &p_path, const String &p_entry_
|
||||||
|
|
||||||
GDNativeInitializationFunction initialization_function = (GDNativeInitializationFunction)entry_funcptr;
|
GDNativeInitializationFunction initialization_function = (GDNativeInitializationFunction)entry_funcptr;
|
||||||
|
|
||||||
initialization_function(&gdnative_interface, this, &initialization);
|
if (initialization_function(&gdnative_interface, this, &initialization)) {
|
||||||
level_initialized = -1;
|
level_initialized = -1;
|
||||||
return OK;
|
return OK;
|
||||||
|
} else {
|
||||||
|
return FAILED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeExtension::close_library() {
|
void NativeExtension::close_library() {
|
||||||
|
|
Loading…
Reference in a new issue