Browse Source

FileChangeWatcher: Handle exceptions that occur if the directory to be watched was deleted.

pull/1/head
Daniel Grunwald 15 years ago
parent
commit
47aec7d2a5
  1. 12
      src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs

12
src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs

@ -146,6 +146,18 @@ namespace ICSharpCode.SharpDevelop @@ -146,6 +146,18 @@ namespace ICSharpCode.SharpDevelop
watcher.Dispose();
}
watcher = null;
} catch (FileNotFoundException) {
// can occur if directory was deleted externally
if (watcher != null) {
watcher.Dispose();
}
watcher = null;
} catch (ArgumentException) {
// can occur if parent directory was deleted externally
if (watcher != null) {
watcher.Dispose();
}
watcher = null;
}
}

Loading…
Cancel
Save