From 4cd8c24d0742d0d56e62b3ebef7dcd12eaa7d13e Mon Sep 17 00:00:00 2001 From: Nicky Date: Thu, 4 Sep 2014 00:57:32 +0200 Subject: [PATCH] Stop leaking insane amounts of memory in llfasttimerview. --- indra/newview/llfasttimerview.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 9643572c57..1b1f1189d7 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -404,6 +404,15 @@ void LLFastTimerView::draw() if (!mPauseHistory) { mRecording.appendRecording(LLTrace::get_frame_recording().getLastRecording()); + + // Clean up memory. Would be clever if ~TimerBarRow existed and did that, but nope. So do it by hand. + if( mTimerBarRows.size() ) + { + delete[] mTimerBarRows[ mTimerBarRows.size()-1 ].mBars; + mTimerBarRows[ mTimerBarRows.size()-1 ].mBars = 0; // Might look nonsensical, but in case someone adds a dtor later, make sure we're not double freeing. + } + // + mTimerBarRows.pop_back(); mTimerBarRows.push_front(TimerBarRow()); }