1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

memory optimizations (less leaks)

This commit is contained in:
mateuszb 2008-01-23 18:32:24 +00:00
parent 10e4e2937f
commit c66d430702
3 changed files with 3 additions and 1 deletions

View File

@ -782,7 +782,7 @@ int CCreatureAnimation::nextFrame(SDL_Surface *dest, int x, int y)
FTemp+='\0'; FTemp+='\0';
} }
} }
delete RLEntries; delete [] RLEntries;
RLEntries = NULL; RLEntries = NULL;
if (BottomMargin>0) if (BottomMargin>0)
{ {

Binary file not shown.

View File

@ -289,6 +289,7 @@ SDL_Surface * CLodHandler::loadBitmap(std::string fname)
{ {
std::cout<<"an error "<<res<<" occured while extracting file "<<fname<<std::endl; std::cout<<"an error "<<res<<" occured while extracting file "<<fname<<std::endl;
} }
delete [] pcd;
} }
CPCXConv cp; CPCXConv cp;
cp.openPCX((char*)pcx,entries[index].realSize); cp.openPCX((char*)pcx,entries[index].realSize);
@ -464,6 +465,7 @@ std::vector<CDefHandler *> CLodHandler::extractManyFiles(std::vector<std::string
CDefHandler * nh = new CDefHandler; CDefHandler * nh = new CDefHandler;
nh->openFromMemory(decomp, entries[i].realSize, std::string((char*)entries[i].name)); nh->openFromMemory(decomp, entries[i].realSize, std::string((char*)entries[i].name));
nh->alphaTransformed = false; nh->alphaTransformed = false;
delete [] decomp;
ret[curDef] = nh; ret[curDef] = nh;
} }
delete[] outp; delete[] outp;