diff options
author | Max Horn | 2004-08-01 10:02:41 +0000 |
---|---|---|
committer | Max Horn | 2004-08-01 10:02:41 +0000 |
commit | 4ef4583523df87d0db73aed58b5d0a4145affa2e (patch) | |
tree | f29ef61cd6d2edad5f33a9f29dcd70f41a146fa7 /saga/image.cpp | |
parent | 69cf6a070a927ef17932f6d4303460ed5e867668 (diff) | |
download | scummvm-rg350-4ef4583523df87d0db73aed58b5d0a4145affa2e.tar.gz scummvm-rg350-4ef4583523df87d0db73aed58b5d0a4145affa2e.tar.bz2 scummvm-rg350-4ef4583523df87d0db73aed58b5d0a4145affa2e.zip |
Oh the beauty of stack based objects: they free themselves automatically, so you don't leak them all the time (fixed 10e6 object leaks :-)
svn-id: r14417
Diffstat (limited to 'saga/image.cpp')
-rw-r--r-- | saga/image.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/saga/image.cpp b/saga/image.cpp index d8b09f6f8c..a3978c43d4 100644 --- a/saga/image.cpp +++ b/saga/image.cpp @@ -64,12 +64,12 @@ int SagaEngine::decodeBGImage(const byte *image_data, size_t image_size, return R_FAILURE; } - MemoryReadStream *readS = new MemoryReadStream(image_data, image_size); + MemoryReadStream readS(image_data, image_size); - hdr.width = readS->readUint16LE(); - hdr.height = readS->readUint16LE(); - hdr.unknown4 = readS->readUint16LE(); - hdr.unknown6 = readS->readUint16LE(); + hdr.width = readS.readUint16LE(); + hdr.height = readS.readUint16LE(); + hdr.unknown4 = readS.readUint16LE(); + hdr.unknown6 = readS.readUint16LE(); RLE_data_ptr = image_data + SAGA_IMAGE_DATA_OFFSET; RLE_data_len = image_size - SAGA_IMAGE_DATA_OFFSET; |