handzlikchris / handzlikchris/FastScriptReload
ImmersiveVRTools.Common.Runtime: UnityMainThreadDispatcher can't be initialized on worker thread
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 167
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
SafeInvoke(HotReloadFailed, changesAwaitingHotReload) から ProjectWindowReloadStatusIndicatorDrawer.OnHotReloadFailed、UnityMainThreadDispatcher.Instance、SingletonBase へ至る、報告された呼び出しチェーンから始めます。どの初期化パスがワーカースレッドから Unity APIs にアクセスしているかを特定します。報告されたホットリロードの失敗によってワーカースレッドの Unity API 例外が発生しなくなり、関連する動作が Unity で検証されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, unity
- 領域
- devtools, game-dev
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100