aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/plane32.cpp
diff options
context:
space:
mode:
authorColin Snover2016-03-06 16:40:23 -0600
committerColin Snover2016-03-06 21:34:43 -0600
commit36800b701764222ec0c527f68504d1d3dc2e1fcc (patch)
treebc2cd25a328a3301e0207ce380487f276068f7df /engines/sci/graphics/plane32.cpp
parent3e631ca5e3a3e19cb08be83c039ae9681a2e6cbc (diff)
downloadscummvm-rg350-36800b701764222ec0c527f68504d1d3dc2e1fcc.tar.gz
scummvm-rg350-36800b701764222ec0c527f68504d1d3dc2e1fcc.tar.bz2
scummvm-rg350-36800b701764222ec0c527f68504d1d3dc2e1fcc.zip
SCI32: Fix memory leaks
Diffstat (limited to 'engines/sci/graphics/plane32.cpp')
-rw-r--r--engines/sci/graphics/plane32.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp
index 0a0b0ad561..de82a40f9e 100644
--- a/engines/sci/graphics/plane32.cpp
+++ b/engines/sci/graphics/plane32.cpp
@@ -55,6 +55,7 @@ _redrawAllCount(g_sci->_gfxFrameout->getScreenCount()),
_created(g_sci->_gfxFrameout->getScreenCount()),
_updated(0),
_deleted(0),
+_moved(0),
_gameRect(gameRect) {
convertGameRectToPlaneRect();
_priority = MAX(10000, g_sci->_gfxFrameout->getPlanes().getTopPlanePriority() + 1);
@@ -808,6 +809,11 @@ void PlaneList::erase(Plane *plane) {
}
}
+PlaneList::iterator PlaneList::erase(iterator it) {
+ delete *it;
+ return PlaneListBase::erase(it);
+}
+
int PlaneList::findIndexByObject(const reg_t object) const {
for (size_type i = 0; i < size(); ++i) {
if ((*this)[i] != nullptr && (*this)[i]->_object == object) {
@@ -850,6 +856,10 @@ int16 PlaneList::getTopSciPlanePriority() const {
return priority;
}
+void PlaneList::remove_at(size_type index) {
+ delete PlaneListBase::remove_at(index);
+}
+
void PlaneList::add(Plane *plane) {
for (iterator it = begin(); it != end(); ++it) {
if ((*it)->_priority > plane->_priority) {