aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gui
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-14 11:29:09 +0000
committerFilippos Karapetis2009-10-14 11:29:09 +0000
commitcf51ef499ea92dcce10e9d844c06b86a2a847c10 (patch)
tree1df220dc29fbc791d1bee1ae475fa7bdbc4d82a8 /engines/sci/gui
parent5da32b16c2fb3f05cd63bcf8dc984533234c9f24 (diff)
downloadscummvm-rg350-cf51ef499ea92dcce10e9d844c06b86a2a847c10.tar.gz
scummvm-rg350-cf51ef499ea92dcce10e9d844c06b86a2a847c10.tar.bz2
scummvm-rg350-cf51ef499ea92dcce10e9d844c06b86a2a847c10.zip
Plugged loads of memory leaks in the new GUI
svn-id: r45070
Diffstat (limited to 'engines/sci/gui')
-rw-r--r--engines/sci/gui/gui_animate.cpp6
-rw-r--r--engines/sci/gui/gui_gfx.cpp14
2 files changed, 18 insertions, 2 deletions
diff --git a/engines/sci/gui/gui_animate.cpp b/engines/sci/gui/gui_animate.cpp
index a06f652c74..19bcc418a0 100644
--- a/engines/sci/gui/gui_animate.cpp
+++ b/engines/sci/gui/gui_animate.cpp
@@ -205,6 +205,8 @@ void SciGuiAnimate::fill(byte &old_picNotValid) {
listEntry->signal = signal;
listIterator++;
+
+ delete view;
}
}
@@ -466,6 +468,8 @@ void SciGuiAnimate::addToPicDrawCels(List *list) {
}
listIterator++;
+
+ delete view;
}
}
@@ -478,6 +482,8 @@ void SciGuiAnimate::addToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo,
// Create rect according to coordinates and given cel
view->getCelRect(loopNo, celNo, leftPos, topPos, priority, &celRect);
_gfx->drawCel(view, loopNo, celNo, celRect, priority, 0);
+
+ delete view;
}
} // End of namespace Sci
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index ebf54687f4..9a348e5082 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -671,8 +671,10 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo
rect.bottom = rect.top + view->getHeight(loopNo, celNo);
clipRect = rect;
clipRect.clip(_curPort->rect);
- if (clipRect.isEmpty()) // nothing to draw
+ if (clipRect.isEmpty()) { // nothing to draw
+ delete view;
return;
+ }
Common::Rect clipRectTranslated = clipRect;
OffsetRect(clipRectTranslated);
@@ -680,6 +682,8 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo
if (!_screen->_picNotValid)
BitsShow(rect);
}
+
+ delete view;
}
// This version of drawCel is not supposed to call BitsShow()!
@@ -689,13 +693,17 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo
if (view) {
clipRect = celRect;
clipRect.clip(_curPort->rect);
- if (clipRect.isEmpty()) // nothing to draw
+ if (clipRect.isEmpty()) { // nothing to draw
+ delete view;
return;
+ }
Common::Rect clipRectTranslated = clipRect;
OffsetRect(clipRectTranslated);
view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
}
+
+ delete view;
}
// This version of drawCel is not supposed to call BitsShow()!
@@ -1026,6 +1034,8 @@ void SciGuiGfx::SetNowSeen(reg_t objectReference) {
PUT_SEL32V(objectReference, nsTop, celRect.top);
PUT_SEL32V(objectReference, nsBottom, celRect.bottom);
}
+
+ delete view;
}
} // End of namespace Sci