[Scummvm-git-logs] scummvm master -> 496f0d7e85330bad11f3ce63f6369dd5895c0430

neuromancer noreply at scummvm.org
Mon Jan 3 10:45:29 UTC 2022


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:
496f0d7e85 PRIVATE: correctly deallocate initial palette


Commit: 496f0d7e85330bad11f3ce63f6369dd5895c0430
    https://github.com/scummvm/scummvm/commit/496f0d7e85330bad11f3ce63f6369dd5895c0430
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-03T11:44:25+01:00

Commit Message:
PRIVATE: correctly deallocate initial palette

Changed paths:
    engines/private/private.cpp


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index c02100acbbb..f4d02a881f4 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -220,14 +220,16 @@ Common::Error PrivateEngine::run() {
 	_frameImage = decodeImage(_framePath, nullptr);
 	_mframeImage = decodeImage(_framePath, &palette); 
 
-	byte *initialPalette;
-	decodeImage("inface/general/inface1.bmp", &initialPalette);
-	_compositeSurface->setPalette(initialPalette, 0, 256);
-	free(initialPalette);
-
 	_framePalette = (byte *) malloc(3*256);
 	memcpy(_framePalette, palette, 3*256);
 
+	byte *initialPalette;
+	Graphics::Surface *surf = decodeImage("inface/general/inface1.bmp", &initialPalette);
+	_compositeSurface->setPalette(initialPalette, 0, 256);
+	surf->free();
+	delete surf;
+	_image->destroy();
+
 	// Main event loop
 	Common::Event event;
 	Common::Point mousePos;




More information about the Scummvm-git-logs mailing list