diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index 485ef96d21..6ba1bc025e 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -49,6 +49,8 @@ your trainer configuration to do so. (#4448) #### com.unity.ml-agents (C#) - Previously, `com.unity.ml-agents` was not declaring built-in packages as dependencies in its package.json. The relevant dependencies are now listed. (#4384) +- Agents no longer try to send observations when they become disabled if the +Academy has been shut down. (#4489) #### ml-agents / ml-agents-envs / gym-unity (Python) - Fixed the sample code in the custom SideChannel example. (#4466) - A bug in the observation normalizer that would cause rewards to decrease diff --git a/com.unity.ml-agents/Runtime/Agent.cs b/com.unity.ml-agents/Runtime/Agent.cs index 9319a9a5ac..0912062224 100644 --- a/com.unity.ml-agents/Runtime/Agent.cs +++ b/com.unity.ml-agents/Runtime/Agent.cs @@ -491,8 +491,8 @@ protected virtual void OnDisable() Academy.Instance.DecideAction -= DecideAction; Academy.Instance.AgentAct -= AgentStep; Academy.Instance.AgentForceReset -= _AgentReset; + NotifyAgentDone(DoneReason.Disabled); } - NotifyAgentDone(DoneReason.Disabled); m_Brain?.Dispose(); m_Initialized = false; }