Fix NativeExtension::open_library return value when the undelying lib fails to initialize

This commit is contained in:
Emmanuel Leblond 2022-06-12 00:18:08 +02:00
parent 8df8fff54b
commit 228ce1d2b6
No known key found for this signature in database
GPG key ID: C360860E645EFFC0

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