diff options
author | Max Horn | 2008-03-26 22:26:59 +0000 |
---|---|---|
committer | Max Horn | 2008-03-26 22:26:59 +0000 |
commit | d35020ac1778ed9deb6532b226d758ded04a9ce9 (patch) | |
tree | 70869c0be6b161926cc1eaf7724e3a3f3abe840e | |
parent | 762398376fd7a83ab42c4c5aff0058cc8ba94fa0 (diff) | |
download | scummvm-rg350-d35020ac1778ed9deb6532b226d758ded04a9ce9.tar.gz scummvm-rg350-d35020ac1778ed9deb6532b226d758ded04a9ce9.tar.bz2 scummvm-rg350-d35020ac1778ed9deb6532b226d758ded04a9ce9.zip |
Init the _fmtownsBuf in the constructor, not in setupScumm() (fixes a leak, and ensure that _fmtownsBuf always is inited)
svn-id: r31256
-rw-r--r-- | engines/scumm/scumm.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 3a93fae0fa..d2e8404d66 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -528,6 +528,11 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) else _compositeBuf = 0; + _fmtownsBuf = 0; + if (_game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { + _fmtownsBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier); + } + _herculesBuf = 0; if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { _herculesBuf = (byte *)malloc(Common::kHercW * Common::kHercH); @@ -1198,11 +1203,6 @@ void ScummEngine::setupScumm() { Graphics::initfonts(); #endif - _fmtownsBuf = 0; - if (_game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { - _fmtownsBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier); - } - free(_compositeBuf); _compositeBuf = (byte *)malloc(_screenWidth * _textSurfaceMultiplier * _screenHeight * _textSurfaceMultiplier); } |