aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-03 17:14:47 +1000
committerPaul Gilbert2011-07-03 17:14:47 +1000
commitdff8bd5474905c924f4039ab079c20b3f145b364 (patch)
tree8566c9cb59831c3444cbfdf79a859d4ae0d8a579
parentd53142d95e793861d2891f8a7d16ac11b9b94126 (diff)
downloadscummvm-rg350-dff8bd5474905c924f4039ab079c20b3f145b364.tar.gz
scummvm-rg350-dff8bd5474905c924f4039ab079c20b3f145b364.tar.bz2
scummvm-rg350-dff8bd5474905c924f4039ab079c20b3f145b364.zip
CGE: Fix some memory leaks
-rw-r--r--engines/cge/bitmap.cpp1
-rw-r--r--engines/cge/cge.cpp2
-rw-r--r--engines/cge/vga13h.cpp11
3 files changed, 9 insertions, 5 deletions
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index 833d0f1f1b..d0c7ba6ab5 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -122,7 +122,6 @@ Bitmap::Bitmap(uint16 w, uint16 h, uint8 fill)
for (HideDesc *hdP = b + 1; hdP < (b + _h); ++hdP)
*hdP = *b;
- memcpy(b + 1, b, (_h - 1) * sizeof(*b)); // tricky fill entire table
b->skip = 0; // fix the first entry
_v = v;
_b = b;
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index 4af10b2b8d..89d5c0a86e 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -117,7 +117,7 @@ CGEEngine::~CGEEngine() {
// Remove all of our debug levels here
DebugMan.clearAllDebugChannels();
- _console = new CGEConsole(this);
+ delete _console;
// Delete engine objects
delete _sprite;
diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp
index b4e9bff286..35d9688bd3 100644
--- a/engines/cge/vga13h.cpp
+++ b/engines/cge/vga13h.cpp
@@ -912,8 +912,10 @@ void VGA::init() {
}
void VGA::deinit() {
- for (int idx = 0; idx < 4; ++idx)
+ for (int idx = 0; idx < 4; ++idx) {
+ Page[idx]->free();
delete Page[idx];
+ }
delete[] SysPal;
}
@@ -931,7 +933,7 @@ VGA::VGA(int mode)
for (i = 10; i < 20; i++) {
char *txt = Text->getText(i);
if (txt) {
- warning("%s", txt);
+ debugN("%s", txt);
std = false;
}
}
@@ -976,8 +978,11 @@ VGA::~VGA(void) {
if (Nam)
buffer = buffer + " [" + Nam + "]";
- warning("%s", buffer.c_str());
+ debugN("%s", buffer.c_str());
}
+
+ delete ShowQ;
+ delete SpareQ;
}