1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed UpdateRebuildFileWatches removing watched directories

This commit is contained in:
Brian Fiete 2025-01-22 08:05:04 -08:00
parent 18f7a5bd09
commit 61b38b06c5
2 changed files with 17 additions and 1 deletions

View file

@ -987,7 +987,11 @@ namespace IDE.Compiler
{
if (!curWatches.Contains(kv.key))
{
gApp.mFileWatcher.RemoveWatch(kv.key, kv.value);
var watchFile = scope String(kv.key);
if ((watchFile.EndsWith(Path.DirectorySeparatorChar)) || (watchFile.EndsWith(Path.AltDirectorySeparatorChar)))
watchFile.Append("*");
gApp.mFileWatcher.RemoveWatch(watchFile, kv.value);
//Debug.Assert(!gApp.mFileWatcher.HasDependentObject(kv.value));
oldKeys.Add(kv.key);
}
}

View file

@ -581,6 +581,18 @@ namespace IDE
#endif
}
public bool HasDependentObject(Object dependentObject)
{
for (var watchedFileKV in mWatchedFiles)
{
if (watchedFileKV.value.mDependentObjects.Contains(dependentObject))
return true;
}
if (mDependencyChangeSet.Contains(Internal.UnsafeCastToPtr(dependentObject)))
return true;
return false;
}
public void Update(delegate void(String, String, WatcherChangeTypes) fileChangeHandler = null)
{
while (true)