diff --git a/src/Client/DefScript/ListStorage.cpp b/src/Client/DefScript/ListStorage.cpp index 7d1ee5f..d443115 100644 --- a/src/Client/DefScript/ListStorage.cpp +++ b/src/Client/DefScript/ListStorage.cpp @@ -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++); + } +} diff --git a/src/Client/DefScript/ListStorage.h b/src/Client/DefScript/ListStorage.h index 3d7ef7f..c6c42a7 100644 --- a/src/Client/DefScript/ListStorage.h +++ b/src/Client/DefScript/ListStorage.h @@ -11,6 +11,8 @@ typedef std::map DefListMap; class ListStorage { public: + ~ListStorage(); + bool Exists(std::string); void Delete(std::string); DefList *Get(std::string); diff --git a/src/Client/World/CacheHandler.cpp b/src/Client/World/CacheHandler.cpp index 8fdd94b..cca6ccc 100644 --- a/src/Client/World/CacheHandler.cpp +++ b/src/Client/World/CacheHandler.cpp @@ -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::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; diff --git a/src/Client/World/CacheHandler.h b/src/Client/World/CacheHandler.h index e7977b6..fae0623 100644 --- a/src/Client/World/CacheHandler.h +++ b/src/Client/World/CacheHandler.h @@ -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 \ No newline at end of file +#endif diff --git a/src/Client/World/UpdateMask.h b/src/Client/World/UpdateMask.h index 6fddbba..5c2f1a6 100644 --- a/src/Client/World/UpdateMask.h +++ b/src/Client/World/UpdateMask.h @@ -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) {