Skip to content

Commit f42887d

Browse files
committed
Fixing crash when Editor Application is quitting in Runtime Mode
Dispose was not called when editor was quitting resulting in a crash in the Job system when CPU Workers were disposed in finalizers by the garbage collector on the wrong thread.
1 parent f248e98 commit f42887d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ protected Academy()
261261
LazyInitialize();
262262

263263
#if UNITY_EDITOR
264+
EditorApplication.quitting += Dispose;
264265
EditorApplication.playModeStateChanged += HandleOnPlayModeChanged;
265266
#endif
266267
}

0 commit comments

Comments
 (0)