diff options
author | Strangerke | 2015-12-15 22:16:06 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:06 +0100 |
commit | 3f1bb66959dbe72444d7cd1bc36609bf1e3e2f77 (patch) | |
tree | 1d7d0421aaadc7a3051f3adec495098d7425ea37 /engines/lab | |
parent | b42ed683b839d3fc35bf427082aa1f96ee13a553 (diff) | |
download | scummvm-rg350-3f1bb66959dbe72444d7cd1bc36609bf1e3e2f77.tar.gz scummvm-rg350-3f1bb66959dbe72444d7cd1bc36609bf1e3e2f77.tar.bz2 scummvm-rg350-3f1bb66959dbe72444d7cd1bc36609bf1e3e2f77.zip |
LAB: Fix memory leak
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/dispman.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 28d691a963..fd7486e3fa 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -66,6 +66,7 @@ DisplayMan::DisplayMan(LabEngine *vm) : _vm(vm) { DisplayMan::~DisplayMan() { freePict(); delete _dispBitMap; + delete[]_displayBuffer; } // From readPict.c. Reads in pictures and animations from disk. @@ -543,7 +544,10 @@ void DisplayMan::createScreen(bool hiRes) { _screenHeight = 200; } _screenBytesPerPage = _screenWidth * _screenHeight; - _displayBuffer = new byte[_screenBytesPerPage]; // FIXME: Memory leak! + + if (_displayBuffer) + delete[] _displayBuffer; + _displayBuffer = new byte[_screenBytesPerPage]; } /** |