Closed nullpainter closed 6 years ago
Maybe you should log it though even if you ignore? Or we might run into issues like our friend where the logs don't help...
I was loathe to as it's just noise, but you're probably right. I was happy enough not to because it's in Dispose()
- but I guess we would care if it left orphaned MAME processes...
Actually, the issue is a bit fiddlier than that. Mid-way through disposing, MAME does start - but then tries to access objects which are disposed. I'll add a check against the cancellation token source; that should do it.
Eh I think I've been bitten by empty try catches too many times. Also sometimes I would just leave a debug.writeline while developing, forget to log properly and then spend hours trying to figure out why something fails haha
Although like you say it's in dispose for a process. So it's probably pretty safe to really ignore...
Looking through the log entries again, the issue was that we were attempting to start MAME while we were shutting down, so I've added the check prior to this:
2018-09-14 15:06:24.938 +12:00 [INF] Stopping screensaver
2018-09-14 15:06:24.949 +12:00 [DBG] Releasing device context for \\.\DISPLAY1
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
I've also moved the message box error out of Program
and into the initial sanity check in MameOrchestrator
. This way, the user receives an error if MAME can't be run but if there is another of these kind of random errors after the screensaver correctly starts, the user isn't confronted with a dialog. I think this is a nicer user experience for a screensaver as it's both non-essential and not something which is being explicitly invoked by the user.
Fantastic Matt, you're a machine 💪
@mika76 do you want to either merge your
azure-pipelines
branch into master, or disable this check for now in Appveyor?