HUGO: Close Two Memory Leaks.
Note that the first leak is the allocation of the Common::RandomSource, _rnd. I'm not sure of the effect of deallocating this while it is still registered to g_eventRec, but all other engines seem to be the same (or implicitly do this by making a Common::RandomSource member of the engine object) so this is not a engine specific issue, but should be assessed. svn-id: r54659
This commit is contained in:
parent
1fbd80b1e3
commit
27a3173d93
2 changed files with 7 additions and 0 deletions
|
@ -343,7 +343,12 @@ bool ObjectHandler::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) {
|
|||
* Free ObjectArr (before exiting)
|
||||
*/
|
||||
void ObjectHandler::freeObjectArr() {
|
||||
for(int16 i = 0; i < _objCount; i++) {
|
||||
free(_objects[i].stateDataIndex);
|
||||
_objects[i].stateDataIndex = 0;
|
||||
}
|
||||
free(_objects);
|
||||
_objects = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue