mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
fix yaml hotreloading (#5907)
This commit is contained in:
@@ -25,6 +25,7 @@ internal sealed class ReloadManager : IReloadManager
|
||||
private readonly TimeSpan _reloadDelay = TimeSpan.FromMilliseconds(10);
|
||||
private CancellationTokenSource _reloadToken = new();
|
||||
private readonly HashSet<ResPath> _reloadQueue = new();
|
||||
private List<FileSystemWatcher> _watchers = new(); // this list is never used but needed to prevent them from being garbage collected
|
||||
|
||||
public event Action<ResPath>? OnChanged;
|
||||
|
||||
@@ -93,6 +94,7 @@ internal sealed class ReloadManager : IReloadManager
|
||||
NotifyFilter = NotifyFilters.LastWrite
|
||||
};
|
||||
|
||||
_watchers.Add(watcher); // prevent garbage collection
|
||||
|
||||
watcher.Changed += OnWatch;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user