Browse Source

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

https://winscp.net/tracker/1462
(cherry picked from commit e163377bcfcdf112a2ac20977f0c29ca0a097606)

Source commit: 1191bf3e69e4edf35c6fe9af07ec9f92c2f421f0
Martin Prikryl 8 years ago
parent
commit
7a16001f4c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      source/core/RemoteFiles.cpp

+ 2 - 1
source/core/RemoteFiles.cpp

@@ -1482,10 +1482,11 @@ void __fastcall TRemoteFileList::AddFile(TRemoteFile * File)
 TStrings * __fastcall TRemoteFileList::CloneStrings(TStrings * List)
 TStrings * __fastcall TRemoteFileList::CloneStrings(TStrings * List)
 {
 {
   std::unique_ptr<TStringList> Result(new TStringList());
   std::unique_ptr<TStringList> Result(new TStringList());
+  Result->OwnsObjects = true;
   for (int Index = 0; Index < List->Count; Index++)
   for (int Index = 0; Index < List->Count; Index++)
   {
   {
     TRemoteFile * File = static_cast<TRemoteFile *>(List->Objects[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();
   return Result.release();
 }
 }