* fixed more memleaks. thx bLuma!

This commit is contained in:
False.Genesis 2007-10-28 17:32:45 +00:00
parent c7cc44d4cb
commit e0696bd244
2 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,11 @@ DrawObjMgr::~DrawObjMgr()
DEBUG( logdebug("del for guid "I64FMT, i->first) );
delete i->second; // this can be done safely, since the object ptrs are not accessed
}
while(_add.size())
{
delete _add.next().second;
}
}
void DrawObjMgr::Add(uint64 objguid, DrawObject *o)

View File

@ -40,7 +40,10 @@ bool PlayerNameCache::AddInfo(PlayerNameCacheItem* cacheItem)
{
for(std::vector<PlayerNameCacheItem*>::iterator i=_cache.begin(); i!=_cache.end(); i++)
if(cacheItem->_guid==(*i)->_guid)
{
delete cacheItem;
return false;
}
_cache.push_back(cacheItem);
return true;
}
@ -261,7 +264,8 @@ void ItemProtoCache_InsertDataToSession(WorldSession *session)
//DEBUG(logdebug("ItemProtoCache: Loaded %u [%s]",proto->Id, proto->Name[0].c_str()));
session->objmgr.Add(proto);
counter++;
}
} else
delete proto;
}
fh.close();
log("ItemProtoCache: Loaded %u Item Prototypes",counter);