aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2010-08-02 22:12:45 +0000
committerMartin Kiewitz2010-08-02 22:12:45 +0000
commita1001731fa50c730dcf834b724edfb89a8352298 (patch)
tree7a0cf378e09f2f0d11e243583bb739cfa7eefa10 /engines
parent0f339921edc7908fafa4a9098211255abd6ee13c (diff)
downloadscummvm-rg350-a1001731fa50c730dcf834b724edfb89a8352298.tar.gz
scummvm-rg350-a1001731fa50c730dcf834b724edfb89a8352298.tar.bz2
scummvm-rg350-a1001731fa50c730dcf834b724edfb89a8352298.zip
SCI: fixing leak kernel subfunctions
svn-id: r51665
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 73fb3de062..e702002199 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -43,8 +43,17 @@ Kernel::Kernel(ResourceManager *resMan, SegManager *segMan)
}
Kernel::~Kernel() {
- for (KernelFunctionArray::iterator i = _kernelFuncs.begin(); i != _kernelFuncs.end(); ++i)
- delete[] i->signature;
+ for (KernelFunctionArray::iterator it = _kernelFuncs.begin(); it != _kernelFuncs.end(); ++it) {
+ if (it->subFunctionCount) {
+ uint16 subFunctionNr = 0;
+ while (subFunctionNr < it->subFunctionCount) {
+ delete[] it->subFunctions[subFunctionNr].signature;
+ subFunctionNr++;
+ }
+ delete[] it->subFunctions;
+ }
+ delete[] it->signature;
+ }
}
uint Kernel::getSelectorNamesSize() const {