aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kernel32.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-02-08 15:51:00 +0000
committerMatthew Hoops2010-02-08 15:51:00 +0000
commit7147f8577e08bcb037cba390dbef3e90163fb96f (patch)
tree2ebed6871a7f97b2b8ed92a232092585c2dd6bac /engines/sci/engine/kernel32.cpp
parent6938ca072aa05600ece0b7041e47a0fe8e4abba4 (diff)
downloadscummvm-rg350-7147f8577e08bcb037cba390dbef3e90163fb96f.tar.gz
scummvm-rg350-7147f8577e08bcb037cba390dbef3e90163fb96f.tar.bz2
scummvm-rg350-7147f8577e08bcb037cba390dbef3e90163fb96f.zip
Search through arrays for outgoing references to fix possible garbage collector problems; minor cleanup.
svn-id: r47989
Diffstat (limited to 'engines/sci/engine/kernel32.cpp')
-rw-r--r--engines/sci/engine/kernel32.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp
index 4669256df4..8d70cdf45b 100644
--- a/engines/sci/engine/kernel32.cpp
+++ b/engines/sci/engine/kernel32.cpp
@@ -439,8 +439,7 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) {
return argv[1]; // We also have to return the handle
}
case 4: // Free
- if (!argv[1].isNull())
- s->_segMan->freeArray(argv[1]);
+ // Freeing of arrays is handled by the garbage collector
return s->r_acc;
case 5: { // Fill
SciArray<reg_t> *array = s->_segMan->lookupArray(argv[1]);
@@ -542,8 +541,7 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) {
return argv[1]; // We also have to return the handle
}
case 4: // Free
- if (!argv[1].isNull())
- s->_segMan->freeString(argv[1]);
+ // Freeing of strings is handled by the garbage collector
return s->r_acc;
case 5: { // Fill
SciString *string = s->_segMan->lookupString(argv[1]);