Closed mthiel closed 2 years ago
I don't see why this would fix it. There shouldn't be any LongEvents running, so the code will just be run instantly in the same thread.
I believe this change is obsolete now and should be closed. Thanks for taking a look!
For posterity: The stack-trace suggested to me that something else was calling MainTabWindow_Architect.CacheDesPanels in an unexpected way during loading. Running it through LongEventHandler seemed to have the side-effect of invoking on the main thread instead, although I can't explain why that would be the case.
With the recent improvements you made, it's now occurring while loading save a instead, but it's being successfully caught by your check. After that, opening the architect menu triggers RestoreState from the main thread and everything seems to work as intended.
Improved FixDesPanels compatibility with mods that may invoke this from the wrong thread.
Spotted this issue when testing with my full mod list.