From 6ea375b8907374fba6b3594c207eba91c9ef7622 Mon Sep 17 00:00:00 2001 From: Joost Peters Date: Tue, 30 May 2006 21:22:52 +0000 Subject: free old buffers when changing resolution in the non-GU backend (not that it's ever used, but anyway) svn-id: r22787 --- backends/psp/osys_psp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backends/psp/osys_psp.cpp b/backends/psp/osys_psp.cpp index 1d5712e226..9bac3f28c6 100644 --- a/backends/psp/osys_psp.cpp +++ b/backends/psp/osys_psp.cpp @@ -115,8 +115,15 @@ int OSystem_PSP::getGraphicsMode() const { void OSystem_PSP::initSize(uint width, uint height) { _overlayWidth = _screenWidth = width; _overlayHeight = _screenHeight = height; + + if (_offscreen) + free(_offscreen); + _offscreen = (byte *)malloc(width * height); + if (_overlayBuffer) + free(_overlayBuffer); + _overlayBuffer = (OverlayColor *)malloc(_overlayWidth * _overlayHeight * sizeof(OverlayColor)); bzero(_offscreen, width * height); clearOverlay(); -- cgit v1.2.3