KnossosNET / Knossos.NET

Repository for the Knossos.NET launcher, currently in development.
GNU General Public License v3.0
21 stars 10 forks source link

Crash encountered using -playmod option #120

Closed notimaginative closed 6 months ago

notimaginative commented 6 months ago

I've never actually tested the -playmod option before so I don't know if this is old or new. I've also only tested on Mac so far so I'm not sure if this is platform specific or not. But when using -playmod it will launch the mod successfully and then crash when attempting to close kNet itself.

Here's the message when debugging:

Exception has occurred: CLR/System.InvalidOperationException
An exception of type 'System.InvalidOperationException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'Call from invalid thread'
   at Avalonia.Threading.Dispatcher.<VerifyAccess>g__ThrowVerifyAccess|16_0()
   at Avalonia.Controls.Window.CloseInternal()
   at Avalonia.Controls.Window.CloseCore(WindowCloseReason reason, Boolean isProgrammatic)
   at Knossos.NET.Knossos.<QuickLaunch>d__14.MoveNext() in /Users/taylor/Working/src/code/Knossos.NET/Knossos.NET/Classes/Knossos.cs:line 231
   at Knossos.NET.Knossos.<LoadBasePath>d__18.MoveNext() in /Users/taylor/Working/src/code/Knossos.NET/Knossos.NET/Classes/Knossos.cs:line 606

The offending line is MainWindow.instance!.Close() in QuickLaunch().