Skip to content

Commit bf85fad

Browse files
committed
Proper core shutdown
1 parent 29e2205 commit bf85fad

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Runtime/Code/Luau/LuauCore.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,13 @@ public void OnDestroy() {
244244
#if UNITY_EDITOR
245245
EditorApplication.pauseStateChanged -= OnPauseStateChanged;
246246
#endif
247-
Profiler.BeginSample("ShutdownLuauState");
248-
LuauState.ShutdownAll();
249-
Profiler.EndSample();
250-
if (_coreInstance && _coreInstance == this) {
247+
if (_coreInstance == this) {
248+
_coreInstance = null;
251249
initialized = false;
250+
LuauState.ShutdownAll();
252251
Profiler.BeginSample("ShutdownLuauPlugin");
253252
LuauPlugin.LuauShutdown();
254253
Profiler.EndSample();
255-
_coreInstance = null;
256254
if (endOfFrameCoroutine != null) {
257255
StopCoroutine(endOfFrameCoroutine);
258256
}

0 commit comments

Comments
 (0)