Fix crashing on exit
Fix crashing on exit

MerryMage/mgba,fr500/mgba,libretro/mgba,mgba-emu/mgba,Anty-Lemon/mgba,nattthebear/mgba,Touched/mgba,Touched/mgba,cassos/mgba,sergiobenrocha2/mgba,iracigt/mgba,cassos/mgba,matthewbauer/mgba,askotx/mgba,matthewbauer/mgba,jeremyherbert/mgba,askotx/mgba,zerofalcon/mgba,zerofalcon/mgba,Touched/mgba,mgba-emu/mgba,fr500/mgba,nattthebear/mgba,sergiobenrocha2/mgba,Anty-Lemon/mgba,sergiobenrocha2/mgba,jeremyherbert/mgba,Anty-Lemon/mgba,AdmiralCurtiss/mgba,iracigt/mgba,libretro/mgba,bentley/mgba,askotx/mgba,Iniquitatis/mgba,zerofalcon/mgba,Iniquitatis/mgba,Iniquitatis/mgba,Iniquitatis/mgba,libretro/mgba,fr500/mgba,Anty-Lemon/mgba,cassos/mgba,AdmiralCurtiss/mgba,iracigt/mgba,mgba-emu/mgba,bentley/mgba,iracigt/mgba,libretro/mgba,AdmiralCurtiss/mgba,fr500/mgba,libretro/mgba,jeremyherbert/mgba,MerryMage/mgba,sergiobenrocha2/mgba,askotx/mgba,MerryMage/mgba,sergiobenrocha2/mgba,jeremyherbert/mgba,mgba-emu/mgba