Skip to content

Commit

Permalink
Merge pull request #83734 from MarioLiebisch/fix-extension-load-error
Browse files Browse the repository at this point in the history
GDExtension: Fixed error on loading extensions
  • Loading branch information
akien-mga committed Oct 22, 2023
2 parents 14913f1 + f2bcd7d commit 542f6e1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/extension/gdextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,13 +959,15 @@ Ref<Resource> GDExtensionResourceLoader::load(const String &p_path, const String
// object if one has already been loaded (even if caching is disabled at the resource
// loader level).
GDExtensionManager *manager = GDExtensionManager::get_singleton();
Ref<GDExtension> lib = manager->get_extension(p_path);
if (lib.is_null()) {
Error err = load_gdextension_resource(p_path, lib);
if (err != OK && r_error) {
// Errors already logged in load_gdextension_resource().
*r_error = err;
}
if (manager->is_extension_loaded(p_path)) {
return manager->get_extension(p_path);
}

Ref<GDExtension> lib;
Error err = load_gdextension_resource(p_path, lib);
if (err != OK && r_error) {
// Errors already logged in load_gdextension_resource().
*r_error = err;
}
return lib;
}
Expand Down

0 comments on commit 542f6e1

Please sign in to comment.