Closed nullpainter closed 5 years ago
This appears to be caused by MAME being terminated before it has fully started. Looking at the logs, there is a ~60ms window of opportunity for this to happen (!)
Usual log entries:
2018-09-14 13:02:59.762 +12:00 [INF] Invoking MAME with arguments: vastar -skip_gameinfo -nowindow -noswitchres -sleep -triplebuffer -sound none -screen "\\.\DISPLAY2" -artpath c:\code\tools\mame\artwork;C:\Users\matthew_painter\AppData\Local\Temp\Mamesaver\Layouts
2018-09-14 13:02:59.823 +12:00 [DBG] MAME started; pid: 19976
2018-09-14 13:03:02.636 +12:00 [DBG] Exiting due to mouse activity
Failure log entries:
2018-09-14 15:06:24.955 +12:00 [INF] Invoking MAME with arguments: gunbird2 -skip_gameinfo -nowindow -noswitchres -sleep -triplebuffer -sound none -screen "\\.\DISPLAY2" -artpath c:\code\tools\mame\artwork;C:\Users\matthew_painter\AppData\Local\Temp\Mamesaver\Layouts
2018-09-14 15:06:24.955 +12:00 [DBG] Releasing device context for \\.\DISPLAY3
2018-09-14 15:06:24.971 +12:00 [DBG] Releasing device context for \\.\DISPLAY2
2018-09-14 15:06:24.999 +12:00 [DBG] Stopping screen cloning
2018-09-14 15:06:25.001 +12:00 [INF] Closing primary MAME screen \\.\DISPLAY2
2018-09-14 15:06:25.003 +12:00 [ERR] Main
System.InvalidOperationException: No process is associated with this object.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_HasExited()
I'm tempted just to catch InvalidOperationException
in GamePlayManager.Dispose(bool)
.
I haven't been able to replicate, but this is in the logs. May just be a race condition: