Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ShareFileSnapIn/SyncSfItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,18 @@ private bool HasChildren(ShareFileClient client, Folder folder)
/// </summary>
private bool RemoveLocalItem(FileSystemInfo item)
{
item.Delete();

try
{
item.Delete();
}
catch (IOException ioe)
{
// File could not be deleted because it is locked by an object present in heap.
// Calling Garbage collector explicitly to remove the object from the heap so as to unlock and delete the file.
GC.Collect();
GC.WaitForPendingFinalizers();
item.Delete();
}
return true;
}

Expand Down