[Scummvm-cvs-logs] scummvm master -> 0fe605be4b4f6c5890088c5f59e367f4074f8a0f

sev- sev at scummvm.org
Thu Jun 12 09:17:54 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0fe605be4b FULLPIPE: Implement GameVar::~GameVar()


Commit: 0fe605be4b4f6c5890088c5f59e367f4074f8a0f
    https://github.com/scummvm/scummvm/commit/0fe605be4b4f6c5890088c5f59e367f4074f8a0f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-06-12T10:16:53+03:00

Commit Message:
FULLPIPE: Implement GameVar::~GameVar()

Changed paths:
    engines/fullpipe/stateloader.cpp



diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 4164145..141196c 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) {






More information about the Scummvm-git-logs mailing list