[Scummvm-git-logs] scummvm master -> 19f735adf7d76224d337b235f1dc683a0eaafde3

lephilousophe noreply at scummvm.org
Wed Feb 19 21:31:15 UTC 2025


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:
19f735adf7 BACKENDS: SURFACESDL: Fix memory leak


Commit: 19f735adf7d76224d337b235f1dc683a0eaafde3
    https://github.com/scummvm/scummvm/commit/19f735adf7d76224d337b235f1dc683a0eaafde3
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-02-19T22:30:17+01:00

Commit Message:
BACKENDS: SURFACESDL: Fix memory leak

There was a copy paste error.
Also use the new shim instead of an ifdef to destroy the mouse surface.

Changed paths:
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp


diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 7158d90c1a7..26ae558d314 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -250,7 +250,7 @@ SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
 		}
 	}
 	if (_mouseSurface) {
-		destroySurface(_mouseOrigSurface);
+		destroySurface(_mouseSurface);
 	}
 	free(_currentPalette);
 	free(_overlayPalette);
@@ -2473,11 +2473,7 @@ void SurfaceSdlGraphicsManager::blitCursor() {
 
 	if (sizeChanged || !_mouseSurface) {
 		if (_mouseSurface)
-#if SDL_VERSION_ATLEAST(3, 0, 0)
-			SDL_DestroySurface(_mouseSurface);
-#else
-			SDL_FreeSurface(_mouseSurface);
-#endif
+			destroySurface(_mouseSurface);
 
 #if SDL_VERSION_ATLEAST(3, 0, 0)
 		const SDL_PixelFormatDetails *pixelFormatDetails = SDL_GetPixelFormatDetails(_mouseOrigSurface->format);




More information about the Scummvm-git-logs mailing list