duckstation
duckstation copied to clipboard
Possible fix for bug mentioned in Discord
May possibly be a fix for this as well:- https://github.com/stenzek/duckstation/issues/1662
Maybe this prevents crash but... why Bus::g_ram is null there?
It crashes when it goes back to the frontend, after the power down of the emulator core. I'm surmissing that because the memory scanner window was closed down prior to power down it didn't close it properly when you hit power down. And it possibly does a clean up after and Bus::g_ram would be null at that time.
But I'm just guessing - it was a quick fix and didn't investigate more.
May possibly be a fix for this as well:- #1662
Yes, boot and debug fixed!
@PugsyMAME Thanks for exploitation, seems good.
I can confirm that this change fixes #1662 Thanks!
There's still a race condition here - Bus::g_ram could go null between the if and memcpy, since the system shutdown happens on the emu thread. I've held off in fixing this because the proper solutions aren't really great (make shutdown synchronous, or do the search on the emu thread, the latter is probably the least rubbish of the two).