From da956cc1255dd8ad5dfbb3dd38b761f1ab5465e2 Mon Sep 17 00:00:00 2001 From: negativeExponent Date: Fri, 16 Oct 2020 15:53:55 +0800 Subject: [PATCH] Fix malloc/delete mismatch --- libretro.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libretro.cpp b/libretro.cpp index 1c44279..86614f0 100644 --- a/libretro.cpp +++ b/libretro.cpp @@ -545,8 +545,19 @@ void retro_get_system_av_info(struct retro_system_av_info *info) void retro_deinit() { - delete surf; - surf = NULL; + if (surf) + { + if (surf->pixels16) + free(surf->pixels16); + surf->pixels16 = NULL; + + if (surf->pixels) + free(surf->pixels); + surf->pixels = NULL; + + free (surf); + surf = NULL; + } libretro_supports_input_bitmasks = false; }