diff options
| author | Nicola Mettifogo | 2007-03-24 16:36:13 +0000 | 
|---|---|---|
| committer | Nicola Mettifogo | 2007-03-24 16:36:13 +0000 | 
| commit | 10048eaec1e97a6301968bf5fe5a7b596d97dd05 (patch) | |
| tree | 973ab8efa0e7be0cf768183915c7f3a1fa2b7903 | |
| parent | fee9c9fe80ccd6fc173b52f32774a04e2a498d49 (diff) | |
| download | scummvm-rg350-10048eaec1e97a6301968bf5fe5a7b596d97dd05.tar.gz scummvm-rg350-10048eaec1e97a6301968bf5fe5a7b596d97dd05.tar.bz2 scummvm-rg350-10048eaec1e97a6301968bf5fe5a7b596d97dd05.zip | |
- fixed regression bug: one free/delete mismatch
- added needed virtual destructors to structs
svn-id: r26292
| -rw-r--r-- | engines/parallaction/commands.cpp | 2 | ||||
| -rw-r--r-- | engines/parallaction/commands.h | 7 | ||||
| -rw-r--r-- | engines/parallaction/defs.h | 4 | ||||
| -rw-r--r-- | engines/parallaction/location.cpp | 8 | 
4 files changed, 18 insertions, 3 deletions
| diff --git a/engines/parallaction/commands.cpp b/engines/parallaction/commands.cpp index 1b46b77cb8..a0c5972633 100644 --- a/engines/parallaction/commands.cpp +++ b/engines/parallaction/commands.cpp @@ -200,7 +200,7 @@ void freeCommands(Command *list) {  	while (cmd) {  		Command *v4 = (Command*)cmd->_next; -		if (cmd->_id == 6) delete cmd->u._zone;	// open +		if (cmd->_id == CMD_LOCATION) free(cmd->u._string);  		delete cmd;  		cmd = v4; diff --git a/engines/parallaction/commands.h b/engines/parallaction/commands.h index 40c5c1b626..eed3160480 100644 --- a/engines/parallaction/commands.h +++ b/engines/parallaction/commands.h @@ -50,6 +50,9 @@ union CommandData {  	CommandData() {  		_flags = 0;  	} + +	~CommandData() { +	}  };  struct Command : public Node { @@ -63,6 +66,10 @@ struct Command : public Node {  		_flagsOn = 0;  		_flagsOff = 0;  	} + +	~Command() { + +	}  };  } // namespace Parallaction diff --git a/engines/parallaction/defs.h b/engines/parallaction/defs.h index 6d82098022..f5325c760d 100644 --- a/engines/parallaction/defs.h +++ b/engines/parallaction/defs.h @@ -41,6 +41,10 @@ struct Node {  		_prev = NULL;  		_next = NULL;  	} + +	virtual ~Node() { + +	}  };  struct WalkNode : public Node { diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp index 80af47eecf..597f867573 100644 --- a/engines/parallaction/location.cpp +++ b/engines/parallaction/location.cpp @@ -196,14 +196,18 @@ void Parallaction::freeLocation() {  	helperNode._prev = helperNode._next = NULL;  	_vm->freeZones(_zones._next);  	freeNodeList(_zones._next); -	memcpy(&_zones, &helperNode, sizeof(Node)); +	_zones._next = helperNode._next; +	_zones._prev = helperNode._prev; +//	memcpy(&_zones, &helperNode, sizeof(Node));  	debugC(7, kDebugLocation, "freeLocation: zones freed");  	helperNode._prev = helperNode._next = NULL;  	_vm->freeZones(_animations._next);  	_vm->freeAnimations();  	freeNodeList(_animations._next); -	memcpy(&_animations, &helperNode, sizeof(Node)); +	_animations._next = helperNode._next; +	_animations._prev = helperNode._prev; +//	memcpy(&_animations, &helperNode, sizeof(Node));  	debugC(7, kDebugLocation, "freeLocation: animations freed");  	if (_vm->_location._comment) { | 
