diff --git a/core/extension/gdextension_library_loader.cpp b/core/extension/gdextension_library_loader.cpp index b35567305b..439fddfcbf 100644 --- a/core/extension/gdextension_library_loader.cpp +++ b/core/extension/gdextension_library_loader.cpp @@ -200,7 +200,10 @@ Error GDExtensionLibraryLoader::open_library(const String &p_path) { // Apple has a complex lookup system which goes beyond looking up the filename, so we try that first. err = OS::get_singleton()->open_dynamic_library(abs_path, library, &data); if (err != OK) { +#ifdef APPLE_EMBEDDED_ENABLED err = OS::get_singleton()->open_dynamic_library(String(), library, &data); +#endif + if (err != OK) { return err; } diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 04d4783ef9..1cf034bf48 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -480,12 +480,11 @@ Error OS_Windows::open_dynamic_library(const String &p_path, void *&p_library_ha if (!FileAccess::exists(path)) { //this code exists so gdextension can load .dll files from within the executable path path = get_executable_path().get_base_dir().path_join(p_path.get_file()); + ERR_FAIL_COND_V(!FileAccess::exists(path), ERR_FILE_NOT_FOUND); } // Path to load from may be different from original if we make copies. String load_path = path; - ERR_FAIL_COND_V(!FileAccess::exists(path), ERR_FILE_NOT_FOUND); - // Here we want a copy to be loaded. // This is so the original file isn't locked and can be updated by a compiler. if (p_data != nullptr && p_data->generate_temp_files) {