aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-06-12 10:16:14 +0300
committerEugene Sandulenko2014-06-12 10:16:53 +0300
commit0fe605be4b4f6c5890088c5f59e367f4074f8a0f (patch)
treeab666b791257901fed7dc39633136f9dfa36fd42
parent46f30804d87cf5684c932477226c26754d671a1f (diff)
downloadscummvm-rg350-0fe605be4b4f6c5890088c5f59e367f4074f8a0f.tar.gz
scummvm-rg350-0fe605be4b4f6c5890088c5f59e367f4074f8a0f.tar.bz2
scummvm-rg350-0fe605be4b4f6c5890088c5f59e367f4074f8a0f.zip
FULLPIPE: Implement GameVar::~GameVar()
-rw-r--r--engines/fullpipe/stateloader.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 41641457d3..141196c7d7 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -162,7 +162,43 @@ GameVar::GameVar() {
}
GameVar::~GameVar() {
- warning("STUB: GameVar::~GameVar()");
+ if (_varType == 2)
+ free(_value.stringValue);
+
+ if (_parentVarObj && !_prevVarObj ) {
+ if (_parentVarObj->_subVars == this) {
+ _parentVarObj->_subVars = _nextVarObj;
+ } else if (_parentVarObj->_field_14 == this) {
+ _parentVarObj->_field_14 = _nextVarObj;
+ } else {
+ _parentVarObj = 0;
+ }
+ }
+
+ if (_prevVarObj)
+ _prevVarObj->_nextVarObj = _nextVarObj;
+
+ if (_nextVarObj)
+ _nextVarObj->_prevVarObj = _prevVarObj;
+
+ _prevVarObj = 0;
+ _nextVarObj = 0;
+
+ GameVar *s = _subVars;
+
+ while (s) {
+ delete s;
+ s = _subVars;
+ }
+
+ s = _field_14;
+
+ while (s) {
+ delete s;
+ s = _field_14;
+ }
+
+ free(_varName);
}
bool GameVar::load(MfcArchive &file) {