[Scummvm-cvs-logs] SF.net SVN: scummvm:[44180] scummvm/trunk/engines/kyra/staticres.cpp
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Fri Sep 18 13:38:01 CEST 2009
Revision: 44180
http://scummvm.svn.sourceforge.net/scummvm/?rev=44180&view=rev
Author: lordhoto
Date: 2009-09-18 11:38:01 +0000 (Fri, 18 Sep 2009)
Log Message:
-----------
Fix some memory leaks, caused by a recent regression in StaticResource::unloadId.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/staticres.cpp
Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp 2009-09-17 22:22:25 UTC (rev 44179)
+++ scummvm/trunk/engines/kyra/staticres.cpp 2009-09-18 11:38:01 UTC (rev 44180)
@@ -603,13 +603,15 @@
void StaticResource::unloadId(int id) {
Common::List<ResData>::iterator pos = _resList.begin();
- for (; pos != _resList.end(); ++pos) {
+ for (; pos != _resList.end();) {
if (pos->id == id || id == -1) {
const FileType *filetype = getFiletype(pos->type);
(this->*(filetype->free))(pos->data, pos->size);
pos = _resList.erase(pos);
if (id != -1)
break;
+ } else {
+ ++pos;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list