avoiding an incorrect ERR_FILE_NOT_FOUND report when the DLL exists but fails to load for another reason
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
This commit is contained in:
committed by
Ivan Shakhov
parent
321b8c944f
commit
e744959de5
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user