diff options
author | simon <none@none> | 2014-02-14 14:57:08 -0800 |
---|---|---|
committer | simon <none@none> | 2014-02-14 14:57:08 -0800 |
commit | 38915f119c5bf3d85084b12939ad815f68fefad0 (patch) | |
tree | c70dbd37bd6242c028485f5a3a69547d2f528c5c /indra | |
parent | 6bb9975de1d3122ec83a5391b35a46ec20d66606 (diff) |
More memory cleanup of containers after DeletePairedPointer() usage.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcharacter/llpose.cpp | 1 | ||||
-rwxr-xr-x | indra/llcommon/llfasttimer.cpp | 1 | ||||
-rwxr-xr-x | indra/llcommon/llstl.h | 1 | ||||
-rwxr-xr-x | indra/llmessage/llcachename.cpp | 1 | ||||
-rwxr-xr-x | indra/llmessage/llhttpnode.cpp | 4 | ||||
-rwxr-xr-x | indra/llmessage/llmessagetemplate.h | 1 | ||||
-rwxr-xr-x | indra/llrender/llfontfreetype.cpp | 1 | ||||
-rwxr-xr-x | indra/llui/llkeywords.cpp | 1 | ||||
-rwxr-xr-x | indra/llui/llscrolllistctrl.cpp | 1 | ||||
-rwxr-xr-x | indra/llvfs/llvfs.cpp | 1 | ||||
-rwxr-xr-x | indra/llwindow/lldxhardware.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llcallingcard.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/lllandmarklist.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llvograss.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/llvotree.cpp | 1 |
15 files changed, 17 insertions, 2 deletions
diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index 55e1b6e9ea..b1a7ebb159 100755 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -461,6 +461,7 @@ LLPoseBlender::LLPoseBlender() LLPoseBlender::~LLPoseBlender() { for_each(mJointStateBlenderPool.begin(), mJointStateBlenderPool.end(), DeletePairedPointer()); + mJointStateBlenderPool.clear(); } //----------------------------------------------------------------------------- diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 01b6e60d2b..58db7d0d17 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -119,6 +119,7 @@ public: ~NamedTimerFactory() { std::for_each(mTimers.begin(), mTimers.end(), DeletePairedPointer()); + mTimers.clear(); delete mTimerRoot; } diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index d3941e1bc9..0a39288f5a 100755 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -98,6 +98,7 @@ struct DeletePointerArray // The general form is: // // std::for_each(somemap.begin(), somemap.end(), DeletePairedPointer()); +// somemap.clear(); // Don't leave dangling pointers around struct DeletePairedPointer { diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 4e22f62a11..13d779ff83 100755 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -278,6 +278,7 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg) LLCacheName::Impl::~Impl() { for_each(mCache.begin(), mCache.end(), DeletePairedPointer()); + mCache.clear(); for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer()); mReplyQueue.clear(); } diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp index 5c2f73eccb..f6ccb5bdda 100755 --- a/indra/llmessage/llhttpnode.cpp +++ b/indra/llmessage/llhttpnode.cpp @@ -76,8 +76,8 @@ LLHTTPNode::LLHTTPNode() // virtual LLHTTPNode::~LLHTTPNode() { - std::for_each(impl.mNamedChildren.begin(), impl.mNamedChildren.end(), - DeletePairedPointer()); + std::for_each(impl.mNamedChildren.begin(), impl.mNamedChildren.end(), DeletePairedPointer()); + impl.mNamedChildren.clear(); delete impl.mWildcardChild; diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index ae8e0087c1..005a49cedf 100755 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -118,6 +118,7 @@ public: ~LLMsgData() { for_each(mMemberBlocks.begin(), mMemberBlocks.end(), DeletePairedPointer()); + mMemberBlocks.clear(); } void addBlock(LLMsgBlkData *blockp) diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 058bef43a5..84c782e958 100755 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -125,6 +125,7 @@ LLFontFreetype::~LLFontFreetype() // Delete glyph info std::for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer()); + mCharGlyphInfoMap.clear(); // mFontBitmapCachep will be cleaned up by LLPointer destructor. // mFallbackFonts cleaned up by LLPointer destructor diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index ddf33cf6e0..39153977bf 100755 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -76,6 +76,7 @@ inline BOOL LLKeywordToken::isTail(const llwchar* s) const LLKeywords::~LLKeywords() { std::for_each(mWordTokenMap.begin(), mWordTokenMap.end(), DeletePairedPointer()); + mWordTokenMap.clear(); std::for_each(mLineTokenList.begin(), mLineTokenList.end(), DeletePointer()); mLineTokenList.clear(); std::for_each(mDelimiterTokenList.begin(), mDelimiterTokenList.end(), DeletePointer()); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7cd49d5a54..d4bbea0f8e 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -322,6 +322,7 @@ LLScrollListCtrl::~LLScrollListCtrl() std::for_each(mItemList.begin(), mItemList.end(), DeletePointer()); mItemList.clear(); std::for_each(mColumns.begin(), mColumns.end(), DeletePairedPointer()); + mColumns.clear(); } diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index b31c6a9944..7b589f5b96 100755 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp @@ -578,6 +578,7 @@ LLVFS::~LLVFS() mFreeBlocksByLength.clear(); for_each(mFreeBlocksByLocation.begin(), mFreeBlocksByLocation.end(), DeletePairedPointer()); + mFreeBlocksByLocation.clear(); unlockAndClose(mDataFP); mDataFP = NULL; diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index 3579b5d42f..b0f4bc5503 100755 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -171,6 +171,7 @@ std::string LLDXDriverFile::dump() LLDXDevice::~LLDXDevice() { for_each(mDriverFiles.begin(), mDriverFiles.end(), DeletePairedPointer()); + mDriverFiles.clear(); } std::string LLDXDevice::dump() @@ -230,6 +231,7 @@ LLDXHardware::LLDXHardware() void LLDXHardware::cleanup() { // for_each(mDevices.begin(), mDevices.end(), DeletePairedPointer()); + // mDevices.clear(); } /* diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 56817a51ba..91741c2a77 100755 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -117,6 +117,7 @@ LLAvatarTracker::~LLAvatarTracker() std::for_each(mObservers.begin(), mObservers.end(), DeletePointer()); mObservers.clear(); std::for_each(mBuddyInfo.begin(), mBuddyInfo.end(), DeletePairedPointer()); + mBuddyInfo.clear(); } void LLAvatarTracker::track(const LLUUID& avatar_id, const std::string& name) diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index dd402de394..a92df8250e 100755 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -46,6 +46,7 @@ LLLandmarkList gLandmarkList; LLLandmarkList::~LLLandmarkList() { std::for_each(mList.begin(), mList.end(), DeletePairedPointer()); + mList.clear(); } LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t cb) diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 485b0dc8ad..600b44d371 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -241,6 +241,7 @@ void LLVOGrass::initClass() void LLVOGrass::cleanupClass() { for_each(sSpeciesTable.begin(), sSpeciesTable.end(), DeletePairedPointer()); + sSpeciesTable.clear(); } U32 LLVOGrass::processUpdateMessage(LLMessageSystem *mesgsys, diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 6a89100bf5..b82c4fe769 100755 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -269,6 +269,7 @@ void LLVOTree::initClass() void LLVOTree::cleanupClass() { std::for_each(sSpeciesTable.begin(), sSpeciesTable.end(), DeletePairedPointer()); + sSpeciesTable.clear(); } U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys, |