aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/engine/seg_manager.cpp13
-rw-r--r--engines/sci/engine/seg_manager.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index c75ceab280..2be3184b59 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -63,7 +63,7 @@ void SegManager::resetSegMan() {
// Free memory
for (uint i = 0; i < _heap.size(); i++) {
if (_heap[i])
- deallocate(i, false);
+ deallocate(i);
}
_heap.clear();
@@ -151,7 +151,7 @@ Script *SegManager::allocateScript(int script_nr, SegmentId *segid) {
return (Script *)mem;
}
-void SegManager::deallocate(SegmentId seg, bool recursive) {
+void SegManager::deallocate(SegmentId seg) {
VERIFY(check(seg), "invalid seg id");
SegmentObj *mobj = _heap[seg];
@@ -159,8 +159,8 @@ void SegManager::deallocate(SegmentId seg, bool recursive) {
if (mobj->getType() == SEG_TYPE_SCRIPT) {
Script *scr = (Script *)mobj;
_scriptSegMap.erase(scr->getScriptNumber());
- if (recursive && scr->_localsSegment)
- deallocate(scr->_localsSegment, recursive);
+ if (scr->_localsSegment)
+ deallocate(scr->_localsSegment);
}
delete mobj;
@@ -176,8 +176,7 @@ bool SegManager::isHeapObject(reg_t pos) const {
}
void SegManager::deallocateScript(int script_nr) {
- SegmentId seg = getScriptSegment(script_nr);
- deallocate(seg, true);
+ deallocate(getScriptSegment(script_nr));
}
Script *SegManager::getScript(const SegmentId seg) {
@@ -864,7 +863,7 @@ bool SegManager::freeDynmem(reg_t addr) {
if (addr.segment < 1 || addr.segment >= _heap.size() || !_heap[addr.segment] || _heap[addr.segment]->getType() != SEG_TYPE_DYNMEM)
return false; // error
- deallocate(addr.segment, true);
+ deallocate(addr.segment);
return true; // OK
}
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 61fa2e2245..58c88ca870 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -477,7 +477,7 @@ private:
private:
SegmentObj *allocSegment(SegmentObj *mem, SegmentId *segid);
- void deallocate(SegmentId seg, bool recursive);
+ void deallocate(SegmentId seg);
void createClassTable();
SegmentId findFreeSegment() const;