Skip to content

Commit

Permalink
Merge pull request #2404 from Wang-Yue/patch-10
Browse files Browse the repository at this point in the history
fix memory leak of mainmenu in studio.c
  • Loading branch information
nesbox authored Dec 17, 2023
2 parents 8bae7dd + 41e242d commit 3ba3ba6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/studio/studio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,7 @@ static void switchBank(Studio* studio, s32 bank)
void gotoMenu(Studio* studio)
{
setStudioMode(studio, TIC_MENU_MODE);
studio_mainmenu_free(studio->mainmenu);
studio->mainmenu = studio_mainmenu_init(studio->menu, studio->config);
}

Expand Down Expand Up @@ -2541,7 +2542,7 @@ Studio* studio_create(s32 argc, char **argv, s32 samplerate, tic80_pixel_color_f
studio->menu = studio_menu_create(studio);
studio->config = calloc(1, sizeof(Config));
}

studio->mainmenu = NULL;
tic_fs_makedir(studio->fs, TIC_LOCAL);
tic_fs_makedir(studio->fs, TIC_LOCAL_VERSION);

Expand Down

0 comments on commit 3ba3ba6

Please sign in to comment.