handzlikchris / handzlikchris/FastScriptReload
ImmersiveVRTools.Common.Runtime: UnityMainThreadDispatcher can't be initialized on worker thread
- Lenguaje dominante
- C#
- Estrellas
- 2.2k
- Forks
- 167
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con la cadena de llamadas reportada desde SafeInvoke(HotReloadFailed, changesAwaitingHotReload), pasando por ProjectWindowReloadStatusIndicatorDrawer.OnHotReloadFailed, UnityMainThreadDispatcher.Instance y SingletonBase. Determina qué ruta de inicialización accede a las Unity APIs desde el hilo de trabajo. Se considera terminado cuando el fallo de hot-reload reportado ya no provoca una excepción de Unity API desde un hilo de trabajo y el comportamiento relevante se ha verificado en Unity.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, unity
- Área
- devtools, game-dev
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100