Skip to content
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

Fix IFileSystemWatcher instances not being removed from AggregateFSWs #32

Merged
merged 1 commit into from
Aug 21, 2018

Conversation

Rohansi
Copy link
Contributor

@Rohansi Rohansi commented Aug 21, 2018

The watchers had FileSystem set to the MountFileSystem and removal was checking for the internal IFileSystem being watched. Those are never going to be the same so the instances were never removed.

I noticed this when I had a PhysicalFileSystem mounted, watched the MountFileSystem, then remove (and dispose) the physical FS instance. When the watcher picks something up it'll throw an ObjectDisposedException trying to use the PhysicalFileSystem instance.

I also moved the removal (and disposal) of those FSWs to happen before FS disposal could happen to avoid a similar disposal issue.

…SystemWatchers

Also dispose watchers before the IFileSystem
@xoofx xoofx merged commit a8c4ff7 into xoofx:master Aug 21, 2018
@xoofx
Copy link
Owner

xoofx commented Aug 21, 2018

Thanks! (Glad that you are using it! as I don't have the time for my own project, so it's difficult to evaluate how much the library is reliable on this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants