diff --git a/Sshfs/Sshfs/SftpFilesystem.cs b/Sshfs/Sshfs/SftpFilesystem.cs index 5038924..05a73ac 100644 --- a/Sshfs/Sshfs/SftpFilesystem.cs +++ b/Sshfs/Sshfs/SftpFilesystem.cs @@ -368,6 +368,10 @@ DokanError IDokanOperations.Cleanup(string fileName, DokanFileInfo info) { Log("Cleanup:{0},Delete:{1}", info.Context,info.DeleteOnClose); + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + if (info.Context != null) { (info.Context as SftpContext).Release();