From 7746c00a641dcc7fcc492c54136da3d376734976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Fri, 4 Jun 2021 07:00:30 +0200 Subject: [PATCH] SCI: Fix a tiny memory leak in GfxText16 --- engines/sci/graphics/text16.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index fc5ff44b9cf..f354e6f048d 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -44,6 +44,8 @@ GfxText16::GfxText16(GfxCache *cache, GfxPorts *ports, GfxPaint16 *paint16, GfxS } GfxText16::~GfxText16() { + delete[] _codeFonts; + delete[] _codeColors; } void GfxText16::init() { @@ -768,7 +770,7 @@ void GfxText16::kernelTextSize(const char *text, uint16 languageSplitter, int16 void GfxText16::kernelTextFonts(int argc, reg_t *argv) { int i; - delete _codeFonts; + delete[] _codeFonts; _codeFontsCount = argc; _codeFonts = new GuiResourceId[argc]; for (i = 0; i < argc; i++) { @@ -780,7 +782,7 @@ void GfxText16::kernelTextFonts(int argc, reg_t *argv) { void GfxText16::kernelTextColors(int argc, reg_t *argv) { int i; - delete _codeColors; + delete[] _codeColors; _codeColorsCount = argc; _codeColors = new uint16[argc]; for (i = 0; i < argc; i++) {