Skip to content

Commit

Permalink
Fix a crash when using emulator-related bindings and no game is running.
Browse files Browse the repository at this point in the history
Typically, using the "Screenshot" or "Take/Load a quicksave" bindings after clicking the "Emulation>Stop" button would crash the emulator.

The buttons within the menubar were already greyed out, only the bindings could crash the emulator.
  • Loading branch information
Arignir committed Mar 16, 2024
1 parent 4be7088 commit 0a9a7fd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions source/app/bindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ app_bindings_handle(
return ;
}

/* Bindings that can be used outside of a game */
switch (bind) {
// So far, none
default: break;
}

if (!app->emulation.is_started) {
return ;
}

/* Bindings that cannot be used outside of a game */
switch (bind) {
case BIND_EMULATOR_MUTE: app->audio.mute ^= 1; break;
case BIND_EMULATOR_SCREENSHOT: app_emulator_screenshot(app); break;
Expand Down

0 comments on commit 0a9a7fd

Please sign in to comment.