Skip to content

Commit

Permalink
DM: Fix memory leak in dm.cpp and gfx.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterGrascph committed Aug 26, 2016
1 parent cdf377f commit b7987d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions engines/dm/dm.cpp
Expand Up @@ -86,6 +86,10 @@ Common::Error DMEngine::run() {
_displayMan->updateScreen();
}


delete[] buffer;
delete[] cleanByteImg0Data;

return Common::kNoError;
}

Expand Down
3 changes: 2 additions & 1 deletion engines/dm/gfx.cpp
Expand Up @@ -15,10 +15,11 @@ DisplayMan::~DisplayMan() {
delete[] _compressedData;
delete[] _indexBytePos;
delete[] _currPalette;
delete[] _vgaBuffer;
}

void DisplayMan::setUpScreens(uint16 width, uint16 height) {
_currPalette = new byte[256 * 2];
_currPalette = new byte[256 * 3];
_screenWidth = width;
_screenHeight = height;
_vgaBuffer = new byte[_screenWidth * _screenHeight];
Expand Down

0 comments on commit b7987d8

Please sign in to comment.