TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.21k stars 385 forks source link

Failing to open a rom crashes the emulator #4061

Closed Morilli closed 1 month ago

Morilli commented 1 month ago

Loading any rom or file that results in a failure (no core accepts the loaded file, file not found, etc.) will crash the emulator with the following exception:

System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force) in /src/BizHawk.Client.EmuHawk/MainForm.cs:Zeile 3064.
   bei BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop() in /src/BizHawk.Client.EmuHawk/MainForm.cs:Zeile 893.
   bei BizHawk.Client.EmuHawk.Program.SubMain(String[] args) in /src/BizHawk.Client.EmuHawk/Program.cs:Zeile 346.

This is caused by 3af5b7a7f0ae512523eae4d93be150dde2384560, which added null assignments in ResetMainControllers, which is called from CloseGame.

There are multiple easy ways to fix this, but I plan to properly figure out what CloseGame and CloseRom are supposed to do, fix those functions and delete ResetMainControllers after, as per TODO comment there.

Putting this here so I don't forget it before next RC/release.