https://winscp.net/tracker/2380 (cherry picked from commit ec910f92ccc9e8f36763331815933e3ddae0ed7d) Source commit: f260f5a62bfb2d550780f6111ea0be76b6ae0d31
@@ -2566,6 +2566,8 @@ static bool __fastcall DoRecursiveDeleteFile(
}
while (Result && (FindNextUnchecked(SearchRec) == 0));
+ SearchRec.Close();
+
if (Result)
{
Result = RemoveDir(ApiPath(FileName));