diff --git a/src/core/Akka/Actor/ActorCell.DeathWatch.cs b/src/core/Akka/Actor/ActorCell.DeathWatch.cs index dbb6d6aab79..58203f857db 100644 --- a/src/core/Akka/Actor/ActorCell.DeathWatch.cs +++ b/src/core/Akka/Actor/ActorCell.DeathWatch.cs @@ -176,7 +176,10 @@ protected void TellWatchersWeDied() } finally { - _state = _state.ClearWatching(); + MaintainAddressTerminatedSubscription(() => + { + _state = _state.ClearWatchedBy(); + }); } } diff --git a/src/core/Akka/ActorState.cs b/src/core/Akka/ActorState.cs index aa018a3d7f8..9dab811bb5a 100644 --- a/src/core/Akka/ActorState.cs +++ b/src/core/Akka/ActorState.cs @@ -60,6 +60,11 @@ internal interface IActorState /// TBD IActorState ClearWatching(); /// + /// Clears the `WatchedBy` set + /// + /// TBD + IActorState ClearWatchedBy(); + /// /// Clears the `Termination queue` set /// /// TBD @@ -312,6 +317,16 @@ public IActorState ClearWatching() return this; } + /// + /// TBD + /// + /// TBD + public IActorState ClearWatchedBy() + { + _watchedBy = null; + return this; + } + /// /// TBD /// @@ -547,6 +562,17 @@ public IActorState ClearWatching() } + /// + /// TBD + /// + /// TBD + public IActorState ClearWatchedBy() + { + _watchedBy.Clear(); + return this; + } + + /// /// TBD ///