Stop leaking insane amounts of memory in llfasttimerview.

Nicky 2014-09-04 00:57:32 +02:00
parent 93b312b0c9
commit 4cd8c24d07
1 changed files with 9 additions and 0 deletions

View File

@ -404,6 +404,15 @@ void LLFastTimerView::draw()
if (!mPauseHistory)
{
mRecording.appendRecording(LLTrace::get_frame_recording().getLastRecording());
// <FS:ND> 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.
}
// </FS:ND>
mTimerBarRows.pop_back();
mTimerBarRows.push_front(TimerBarRow());
}