Skip to content

Commit

Permalink
Fix a bug where the entries of the "Recent ROMS" menu could have the …
Browse files Browse the repository at this point in the history
…same ImGui ID.
  • Loading branch information
Arignir committed Oct 16, 2024
1 parent 2c96d5c commit 6c1628f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion source/app/windows/menubar.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,18 @@ app_win_menubar_file(
uint32_t x;

for (x = 0; x < array_length(app->file.recent_roms) && app->file.recent_roms[x]; ++x) {
if (igMenuItem_Bool(hs_basename(app->file.recent_roms[x]), NULL, false, true)) {
char label[128];
char const *basename;

basename = hs_basename(app->file.recent_roms[x]);

if (!strlen(basename)) {
continue;
}

snprintf(label, sizeof(label), "%s##%u", basename, x);

if (igMenuItem_Bool(label, NULL, false, true)) {
char *path;

// app->file.recent_roms[] is modified by `app_emulator_configure_and_run()` so we need to copy
Expand Down

0 comments on commit 6c1628f

Please sign in to comment.