refactor: Ensure stream subscriptions only disposed once

In the debugger, I noticed a few streams were unhooking their internal
onChange callbacks unnecessarily (when they were already unhooked).
This commit is contained in:
John Colvin committed 2026-01-10 12:59:14 -05:00
1 parent 849c6c28e5
commit 9de4b27003
4 files changed
+74 -35

No files matched your search

@@ -102,8 +102,11 @@ namespace BCG
myRealSource.onChange -= currValue;
else
{
myOnChangeDelegate =
(ChangeDelegate) Delegate.Remove (myOnChangeDelegate,currValue);
if (myOnChangeDelegate is null) {
Log.DataFlow.warn("Attempted to remove DataStream callback called when change delegate already null");
} else {
myOnChangeDelegate = (ChangeDelegate)Delegate.Remove(myOnChangeDelegate, currValue);
}
// this is need to avoid a callback in a reentrant add.
if (myPendingAdds.Count > 0)