mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 01:07:58 +01:00
Dispose FileSystemWatcher instance before creating another in FileDialog
This commit is contained in:
@@ -51,6 +51,10 @@ namespace Terminal.Gui {
|
||||
bool valid = false;
|
||||
try {
|
||||
dirInfo = new DirectoryInfo (value == null ? directory.ToString () : value.ToString ());
|
||||
|
||||
// Dispose of the old watcher
|
||||
watcher?.Dispose ();
|
||||
|
||||
watcher = new FileSystemWatcher (dirInfo.FullName);
|
||||
watcher.NotifyFilter = NotifyFilters.Attributes
|
||||
| NotifyFilters.CreationTime
|
||||
|
||||
Reference in New Issue
Block a user