private void OnChildTerminate(Terminated m)
{
lock (_boundActorLock)
{
var boundActor = UnbindActor(m.ActorRef);
if (_closed)
{
// all children stopped and it's time to stop self now
if (_closed && _boundActorMap.Any(i => i.Value.IsChildActor) == false)
Self.Tell(InterfacedPoisonPill.Instance);
}
else
{
if (boundActor != null && boundActor.BindingFlags.HasFlag(ActorBindingFlags.StopThenCloseChannel))
Close();
}
}
}