Skip to content

Commit

Permalink
Merge pull request godotengine#81576 from dsnopek/gdextension-dll-cop…
Browse files Browse the repository at this point in the history
…y-failure

GDExtension: Delete left-over DLL copy before making a new copy
  • Loading branch information
YuriSizov committed Sep 14, 2023
2 parents 495b89e + 6554ccf commit 595aca1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/extension/gdextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,11 @@ Ref<Resource> GDExtensionResourceLoader::load(const String &p_path, const String
// This is so relative path to dependencies are satisfied.
String copy_path = abs_path.get_base_dir().path_join("~" + abs_path.get_file());

// If there's a left-over copy (possibly from a crash) then delete it first.
if (FileAccess::exists(copy_path)) {
DirAccess::remove_absolute(copy_path);
}

Error copy_err = DirAccess::copy_absolute(abs_path, copy_path);
if (copy_err) {
if (r_error) {
Expand Down

0 comments on commit 595aca1

Please sign in to comment.