Fixing crash when Editor Application is quitting in Runtime Mode #6267
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dispose was not called in Academy when editor was quitting resulting in a crash in the Job system when CPU Workers were disposed in finalizers called from background threads (they need to be called on the Main thread)
By calling Dispose before tearing down the job system, CPU Workers are disposed properly the same way they are when you leave play mode.
Proposed change(s)
Added a Dispose action in Academy when Editor Application is quitting
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
SENTIS-1216
UUM-128777
https://unity.slack.com/archives/C03F2JZVC80/p1764831602079699
Types of change(s)
Checklist
Other comments
Tested manually that the crash no longer occurs with the project IN-125845_crash with no adverse effect