[Scummvm-git-logs] scummvm master -> 7746c00a641dcc7fcc492c54136da3d376734976

eriktorbjorn eriktorbjorn at telia.com
Fri Jun 4 05:02:07 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7746c00a64 SCI: Fix a tiny memory leak in GfxText16


Commit: 7746c00a641dcc7fcc492c54136da3d376734976
    https://github.com/scummvm/scummvm/commit/7746c00a641dcc7fcc492c54136da3d376734976
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-06-04T07:00:30+02:00

Commit Message:
SCI: Fix a tiny memory leak in GfxText16

Changed paths:
    engines/sci/graphics/text16.cpp


diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp
index fc5ff44b9c..f354e6f048 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++) {




More information about the Scummvm-git-logs mailing list