handzlikchris / handzlikchris/FastScriptReload

[BUG] UnityMainThreadDispatcher destroyed

Open
#91 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
2.2k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

I just hit this exception.

```
MissingReferenceException: The object of type 'UnityMainThreadDispatcher' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.MonoBehaviour.StartCoroutine (System.Collections.IEnumerator routine) (at :0)
ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher+<>c__DisplayClass2_0.b__0 () (at :0)
ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher.Update () (at :0)
```

I had left Unity open in the background for a few hours, and this exception happened after the first change when I returned. Editor reloading is enabled, and I was not in play mode. Unfortunately I don't have any other information about the circumstances that triggered it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at UnityMainThreadDispatcher, especially Update and the Enqueue callback shown in the stack trace, and inspect when the dispatcher is destroyed or reused. Reproduce the editor-reload scenario outside play mode if possible, then verify that the MissingReferenceException no longer occurs after leaving Unity open and making a change.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
devtools, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.