Skip to content

Commit 2a69c1f

Browse files
author
Chris Elion
authored
Don't call NotifyDone in Agent.OnDisable if Academy is shut down (#4489)
1 parent 8e0108a commit 2a69c1f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ your trainer configuration to do so. (#4448)
4949
#### com.unity.ml-agents (C#)
5050
- Previously, `com.unity.ml-agents` was not declaring built-in packages as
5151
dependencies in its package.json. The relevant dependencies are now listed. (#4384)
52+
- Agents no longer try to send observations when they become disabled if the
53+
Academy has been shut down. (#4489)
5254
#### ml-agents / ml-agents-envs / gym-unity (Python)
5355
- Fixed the sample code in the custom SideChannel example. (#4466)
5456
- A bug in the observation normalizer that would cause rewards to decrease

com.unity.ml-agents/Runtime/Agent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ protected virtual void OnDisable()
491491
Academy.Instance.DecideAction -= DecideAction;
492492
Academy.Instance.AgentAct -= AgentStep;
493493
Academy.Instance.AgentForceReset -= _AgentReset;
494+
NotifyAgentDone(DoneReason.Disabled);
494495
}
495-
NotifyAgentDone(DoneReason.Disabled);
496496
m_Brain?.Dispose();
497497
m_Initialized = false;
498498
}

0 commit comments

Comments
 (0)