Custom illegal character replacement

This commit is contained in:
Michael Bucari-Tovo 2022-06-23 13:01:24 -06:00
parent 184ba84600
commit 2ab466c570
24 changed files with 838 additions and 218 deletions

View file

@ -79,8 +79,13 @@ namespace FileManager
//Stop raising events
fileSystemWatcher?.Dispose();
//Calling CompleteAdding() will cause background scanner to terminate.
directoryChangesEvents?.CompleteAdding();
try
{
//Calling CompleteAdding() will cause background scanner to terminate.
directoryChangesEvents?.CompleteAdding();
}
// if directoryChangesEvents is non-null and isDisposed, this exception is thrown. there's no other way to check >:(
catch (ObjectDisposedException) { }
//Wait for background scanner to terminate before reinitializing.
backgroundScanner?.Wait();