-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Prevent the file watching loop from still being alive after we kill it #1001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@duke7553 Is this supposed to fix the issue where the app sometimes crashes when opening a folder? |
Bug with duplicated items still exists.
throwed at line: RemoveFileOrFolder case FILE_ACTION_RENAMED_OLD_NAME:
RemoveFileOrFolder(FilesAndFolders.ToList().First(x => x.ItemPath.Equals(FileName)));
Debug.WriteLine("File " + FileName + " will be renamed in the working directory.");
break; |
I'm not experiencing the duplicated elements bug anymore, but:
results in the same exception mentioned by @tsvietOK
|
@gave92 Do you think a cancellation token would be appropriate to fix this one? |
@duke7553 The bug I mentioned above (creating->deleting->refresh->crash) appears to be solved 👍 Edit: [learning mode on] Edit 2: |
* Cancel previous watcher * Prevent Duplicate Execution of CloseWatcher() Co-authored-by: Luke Blevins <lukeblevins15@gmail.com>
|
Under certain conditions, execution of blocks of code inside the file watching loop continues although the loop's condition is false, causing unwanted actions to be performed (e.g. using the closed directory handle)
This PR aims to:
Please test this PR by doing the following: