From 27005bdb5f07399785284a85c6c2fac6abd46488 Mon Sep 17 00:00:00 2001 From: kub Date: Thu, 4 Nov 2021 18:26:51 +0100 Subject: [PATCH] libretro, fix memory leak --- platform/libretro/libretro.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index ca0a872f..8942d939 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -1854,7 +1854,6 @@ void retro_init(void) | POPT_EN_PSG|POPT_EN_Z80|POPT_EN_GG_LCD | POPT_EN_MCD_PCM|POPT_EN_MCD_CDDA|POPT_EN_MCD_GFX | POPT_EN_32X|POPT_EN_PWM -//|POPT_DIS_IDLE_DET | POPT_ACC_SPRITES|POPT_DIS_32C_BORDER; #ifdef __arm__ #ifdef _3DS @@ -1902,6 +1901,8 @@ void retro_init(void) void retro_deinit(void) { + size_t i; + #ifdef _3DS linearFree(vout_buf); #elif defined(RENDER_GSKIT_PS2) @@ -1914,5 +1915,12 @@ void retro_deinit(void) vout_buf = NULL; PicoExit(); + for (i = 0; i < sizeof(disks) / sizeof(disks[0]); i++) { + if (disks[i].fname != NULL) { + free(disks[i].fname); + disks[i].fname = NULL; + } + } + libretro_supports_bitmasks = false; } -- 2.39.5