Skip to content

Commit 3b39cdc

Browse files
committed
don't assign watcher objects on initialization
these get created on Start() anyway so we don't need to create them on initialization
1 parent 5c69d9b commit 3b39cdc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Source/FileWatcherEx/FileSystemWatcherEx.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public class FileSystemWatcherEx : IDisposable
1313
private EventProcessor? _processor;
1414
private readonly BlockingCollection<FileChangedEvent> _fileEventQueue = new();
1515

16-
private FileWatcher _watcher = new();
17-
private FileSystemWatcher _fsw = new();
16+
private FileWatcher? _watcher;
17+
private FileSystemWatcher? _fsw;
1818

1919
// Define the cancellation token.
2020
private readonly CancellationTokenSource _cancelSource = new();

0 commit comments

Comments
 (0)