Browse Source

Bug 1462: Failure when moving "Download and Delete" operation to background (2nd try)

https://winscp.net/tracker/1462

Source commit: b36693750558782ef87587846be071ba08af777b
Martin Prikryl 8 years ago
parent
commit
e163377bcf
1 changed files with 2 additions and 1 deletions
  1. 2 1
      source/core/RemoteFiles.cpp

+ 2 - 1
source/core/RemoteFiles.cpp

@@ -1487,10 +1487,11 @@ void __fastcall TRemoteFileList::AddFile(TRemoteFile * File)
 TStrings * __fastcall TRemoteFileList::CloneStrings(TStrings * List)
 {
   std::unique_ptr<TStringList> Result(new TStringList());
+  Result->OwnsObjects = true;
   for (int Index = 0; Index < List->Count; Index++)
   {
     TRemoteFile * File = static_cast<TRemoteFile *>(List->Objects[Index]);
-    Result->AddObject(List->Strings[Index], File);
+    Result->AddObject(List->Strings[Index], File->Duplicate(true));
   }
   return Result.release();
 }