aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/scene.cpp
diff options
context:
space:
mode:
authorColin Snover2017-11-14 12:58:38 -0600
committerEugene Sandulenko2017-11-18 22:35:12 +0100
commitc85f409a0b2fa1094ebd1a51c088d2d830383d38 (patch)
tree7c8ff6215994946f631309f305bdf1da8ede3caf /engines/fullpipe/scene.cpp
parent1337f04122cac5f0343090ac23119e4133624db0 (diff)
downloadscummvm-rg350-c85f409a0b2fa1094ebd1a51c088d2d830383d38.tar.gz
scummvm-rg350-c85f409a0b2fa1094ebd1a51c088d2d830383d38.tar.bz2
scummvm-rg350-c85f409a0b2fa1094ebd1a51c088d2d830383d38.zip
FULLPIPE: Remove memory leaks and manual memory management in Scene
Diffstat (limited to 'engines/fullpipe/scene.cpp')
-rw-r--r--engines/fullpipe/scene.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index 6295e3b2d6..751f9924e0 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -117,18 +117,9 @@ void SceneTag::loadScene() {
g_fp->_currArchive = 0;
}
-Scene::Scene() {
- _sceneId = 0;
- _field_BC = 0;
- _shadows = 0;
- _soundList = 0;
- _libHandle = 0;
-}
+Scene::Scene() : _sceneId(0), _field_BC(0) {}
Scene::~Scene() {
- delete _soundList;
- delete _shadows;
-
// _faObjlist is not used
for (uint i = 0; i < _messageQueueList.size(); i++)
@@ -141,8 +132,6 @@ Scene::~Scene() {
_staticANIObjectList1.clear();
- delete _libHandle;
-
// delete _field_BC;
}
@@ -206,7 +195,7 @@ bool Scene::load(MfcArchive &file) {
assert(0);
}
- _libHandle = g_fp->_currArchive;
+ _libHandle.reset(g_fp->_currArchive);
if (_picObjList.size() > 0 && !_bgname.empty()) {
char fname[260];
@@ -231,12 +220,14 @@ bool Scene::load(MfcArchive &file) {
Shadows *shd = new Shadows();
if (shd->loadFile(shdname))
- _shadows = shd;
+ _shadows.reset(shd);
+ else
+ delete shd;
Common::String slsname = genFileName(0, _sceneId, "sls");
if (g_fp->_soundEnabled) {
- _soundList = new SoundList();
+ _soundList.reset(new SoundList());
if (g_fp->_flgSoundList) {
Common::String nlname = genFileName(17, _sceneId, "nl");