mirror of
https://github.com/godotengine/godot
synced 2024-09-15 23:56:57 +00:00
Merge pull request #80720 from dsnopek/gdextension-dll-copy-error
GDExtension: Remove DLL copy if it fails to load
This commit is contained in:
commit
5dc7e23198
|
@ -689,6 +689,12 @@ Ref<Resource> GDExtensionResourceLoader::load(const String &p_path, const String
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err != OK) {
|
if (err != OK) {
|
||||||
|
#if defined(WINDOWS_ENABLED) && defined(TOOLS_ENABLED)
|
||||||
|
// If the DLL fails to load, make sure that temporary DLL copies are cleaned up.
|
||||||
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
|
DirAccess::remove_absolute(lib->get_temp_library_path());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// Errors already logged in open_library()
|
// Errors already logged in open_library()
|
||||||
return Ref<Resource>();
|
return Ref<Resource>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,7 @@ public:
|
||||||
|
|
||||||
#if defined(WINDOWS_ENABLED) && defined(TOOLS_ENABLED)
|
#if defined(WINDOWS_ENABLED) && defined(TOOLS_ENABLED)
|
||||||
void set_temp_library_path(const String &p_path) { temp_lib_path = p_path; }
|
void set_temp_library_path(const String &p_path) { temp_lib_path = p_path; }
|
||||||
|
String get_temp_library_path() const { return temp_lib_path; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum InitializationLevel {
|
enum InitializationLevel {
|
||||||
|
|
Loading…
Reference in a new issue