diff --git a/src/Client/GUI/DrawObjMgr.cpp b/src/Client/GUI/DrawObjMgr.cpp index 8490c7d..925576f 100644 --- a/src/Client/GUI/DrawObjMgr.cpp +++ b/src/Client/GUI/DrawObjMgr.cpp @@ -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) diff --git a/src/Client/World/CacheHandler.cpp b/src/Client/World/CacheHandler.cpp index cca6ccc..4568aa3 100644 --- a/src/Client/World/CacheHandler.cpp +++ b/src/Client/World/CacheHandler.cpp @@ -40,7 +40,10 @@ bool PlayerNameCache::AddInfo(PlayerNameCacheItem* cacheItem) { for(std::vector::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);