diff --git a/core_impl.c b/core_impl.c index eb4b2fffd0..a8a5acb949 100644 --- a/core_impl.c +++ b/core_impl.c @@ -396,7 +396,9 @@ bool core_unload(void) { video_driver_set_cached_frame_ptr(NULL); - current_core.retro_deinit(); + if (current_core.inited) + current_core.retro_deinit(); + return true; } @@ -407,9 +409,11 @@ bool core_unload_game(void) video_driver_set_cached_frame_ptr(NULL); - current_core.retro_unload_game(); - - current_core.game_loaded = false; + if (current_core.game_loaded) + { + current_core.retro_unload_game(); + current_core.game_loaded = false; + } audio_driver_stop();