diff options
author | Colin Snover | 2017-11-14 13:05:15 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2017-11-18 22:35:12 +0100 |
commit | 7514c5289bb3f1a351aebf834532179925269f5c (patch) | |
tree | d612a253325e039d47e020bd70178d28571ad460 /engines/fullpipe/utils.cpp | |
parent | b90f21597a1f77141dcfcd916850041258164882 (diff) | |
download | scummvm-rg350-7514c5289bb3f1a351aebf834532179925269f5c.tar.gz scummvm-rg350-7514c5289bb3f1a351aebf834532179925269f5c.tar.bz2 scummvm-rg350-7514c5289bb3f1a351aebf834532179925269f5c.zip |
FULLPIPE: Remove manual memory management of streams
Diffstat (limited to 'engines/fullpipe/utils.cpp')
-rw-r--r-- | engines/fullpipe/utils.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 02b235ae32..72a3377f74 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -24,6 +24,7 @@ #include "common/file.h" #include "common/memstream.h" +#include "common/ptr.h" #include "fullpipe/objects.h" #include "fullpipe/motion.h" @@ -166,7 +167,7 @@ void MemoryObject::loadFile(const Common::String &filename) { if (g_fp->_currArchive != _libHandle && _libHandle) g_fp->_currArchive = _libHandle; - Common::SeekableReadStream *s = g_fp->_currArchive->createReadStreamForMember(filename); + Common::ScopedPtr<Common::SeekableReadStream> s(g_fp->_currArchive->createReadStreamForMember(filename)); if (s) { assert(s->size() > 0); @@ -176,8 +177,6 @@ void MemoryObject::loadFile(const Common::String &filename) { debugC(5, kDebugLoading, "Loading %s (%d bytes)", filename.c_str(), _dataSize); _data = (byte *)calloc(_dataSize, 1); s->read(_data, _dataSize); - - delete s; } else { // We have no object to read. This is fine } |