diff options
author | Paul Gilbert | 2012-05-05 10:32:43 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-05 10:32:43 +1000 |
commit | 734fae9193fdabd6dcac5f40f765d904c030f7d1 (patch) | |
tree | 4dfa6f2a449da5b054c43be2c0e331bb490f4a6e /engines/tony/gfxcore.cpp | |
parent | 91328fce56144caf15abc8995b68a5a5a0562f0a (diff) | |
download | scummvm-rg350-734fae9193fdabd6dcac5f40f765d904c030f7d1.tar.gz scummvm-rg350-734fae9193fdabd6dcac5f40f765d904c030f7d1.tar.bz2 scummvm-rg350-734fae9193fdabd6dcac5f40f765d904c030f7d1.zip |
TONY: Fixed some memory leaks identified by Valgrind
Diffstat (limited to 'engines/tony/gfxcore.cpp')
-rw-r--r-- | engines/tony/gfxcore.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp index 5737a6af45..de78b51a4e 100644 --- a/engines/tony/gfxcore.cpp +++ b/engines/tony/gfxcore.cpp @@ -709,11 +709,12 @@ void RMGfxSourceBuffer8RLE::SetAlphaBlendColor(int color) { RMGfxSourceBuffer8RLE::RMGfxSourceBuffer8RLE() { alphaBlendColor = -1; bNeedRLECompress = true; + m_buf = NULL; } RMGfxSourceBuffer8RLE::~RMGfxSourceBuffer8RLE() { if (m_buf != NULL) { - delete m_buf; + delete[] m_buf; m_buf = NULL; } } @@ -833,7 +834,7 @@ void RMGfxSourceBuffer8RLE::CompressRLE(void) { // Ci copia l'immagine compressa x = cur - MegaRLEBuf; m_buf = new byte[x]; - CopyMemory(m_buf, MegaRLEBuf, x); + Common::copy(MegaRLEBuf, MegaRLEBuf + x, m_buf); } void RMGfxSourceBuffer8RLE::Draw(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { |