* fixed some memleaks at shutdown. thx to bLuma for patch!
This commit is contained in:
parent
3717c1cd22
commit
8d261e5da0
@ -43,3 +43,12 @@ DefList *ListStorage::Get(std::string s)
|
||||
DefList *l = GetNoCreate(s);
|
||||
return l ? l : _Create(s);
|
||||
}
|
||||
|
||||
ListStorage::~ListStorage()
|
||||
{
|
||||
for(DefListMap::iterator it = _storage.begin(); it != _storage.end();)
|
||||
{
|
||||
delete it->second;
|
||||
_storage.erase(it++);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@ typedef std::map<std::string,DefList*> DefListMap;
|
||||
class ListStorage
|
||||
{
|
||||
public:
|
||||
~ListStorage();
|
||||
|
||||
bool Exists(std::string);
|
||||
void Delete(std::string);
|
||||
DefList *Get(std::string);
|
||||
|
||||
@ -13,6 +13,14 @@
|
||||
// increase this number whenever you change something that makes old files unusable
|
||||
uint32 ITEMPROTOTYPES_CACHE_VERSION = 0x00000001;
|
||||
|
||||
PlayerNameCache::~PlayerNameCache()
|
||||
{
|
||||
for(std::vector<PlayerNameCacheItem*>::iterator i=_cache.begin(); i!=_cache.end(); i++)
|
||||
{
|
||||
delete *i;
|
||||
}
|
||||
}
|
||||
|
||||
bool PlayerNameCache::AddInfo(uint64 guid, std::string name){
|
||||
PlayerNameCacheItem *cacheItem=new PlayerNameCacheItem;
|
||||
cacheItem->_name=name;
|
||||
|
||||
@ -8,6 +8,8 @@ struct PlayerNameCacheItem {
|
||||
|
||||
class PlayerNameCache {
|
||||
public:
|
||||
~PlayerNameCache();
|
||||
|
||||
std::string GetName(uint64);
|
||||
bool IsKnown(uint64);
|
||||
uint64 GetGuid(std::string);
|
||||
@ -23,4 +25,4 @@ private:
|
||||
void ItemProtoCache_InsertDataToSession(WorldSession *session);
|
||||
void ItemProtoCache_WriteDataToCache(WorldSession *session);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -53,7 +53,13 @@ class UpdateMask
|
||||
inline uint32 GetLength() { return mBlocks << 2; }
|
||||
inline uint32 GetCount() { return mCount; }
|
||||
inline uint8* GetMask() { return (uint8*)mUpdateMask; }
|
||||
inline void SetMask(uint32 *updateMask) { mUpdateMask = updateMask; }
|
||||
inline void SetMask(uint32 *updateMask)
|
||||
{
|
||||
if(mUpdateMask)
|
||||
delete [] mUpdateMask;
|
||||
|
||||
mUpdateMask = updateMask;
|
||||
}
|
||||
|
||||
inline void SetCount (uint32 valuesCount)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user