handzlikchris / handzlikchris/FastScriptReload

ImmersiveVRTools.Common.Runtime: UnityMainThreadDispatcher can't be initialized on worker thread

Ouverte
#134 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C#
Étoiles
2.2k
Forks
167
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Just got hit by an exception where code tried to get the `.gameObject` property from a worker thread. It was during `SafeInvoke(HotReloadFailed, changesAwaitingHotReload);` triggering `ProjectWindowReloadStatusIndicatorDrawer.OnHotReloadFailed` which in turn accesses `UnityMainThreadDispatcher.Instance` which in `SingletonBase` will try to access stuff that should only be accessed on the main thread in case there is no singleton instance. Sorry for oral account of the callstack but my debugger got detached when I was poking around and CBA to repro. 😅

Anyway, maybe the main thread dispatcher needs to eaglery be inited from the main thread (RuntimeInitializeOnLoad?) if its means to be accessed from a worker, or just use another singleton implementation that doesn't hit Unity's API.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par la chaîne d’appels signalée depuis SafeInvoke(HotReloadFailed, changesAwaitingHotReload), en passant par ProjectWindowReloadStatusIndicatorDrawer.OnHotReloadFailed, UnityMainThreadDispatcher.Instance et SingletonBase. Déterminez quel chemin d’initialisation accède aux Unity APIs depuis le thread worker. C’est terminé lorsque l’échec de hot-reload signalé ne déclenche plus d’exception d’Unity API depuis un thread worker et que le comportement concerné a été vérifié dans Unity.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp, unity
Domaine
devtools, game-dev
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.