summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-01-04 14:03:02 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2010-01-04 14:03:02 -0800
commit43cdebefa620c0fe8ad4f9db846d92061134e3f9 (patch)
tree79319927917d2c95979ed702241404aaa99a69d0 /indra/llui
parent659995ce0b1aba06842d0ade4b47028491cd2c5f (diff)
EXT-3318 LLConsole keeps all logged text in memory when console is not being drawn.
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llconsole.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index fa0abd55d0..c9090d388d 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -392,4 +392,10 @@ void LLConsole::addLine(const LLWString& wline, F32 size, const LLColor4 &color)
Paragraph paragraph(wline, color, mTimer.getElapsedTimeF32(), mFont, (F32)getRect().getWidth() );
mParagraphs.push_back ( paragraph );
+
+ // remove old paragraphs which can't possibly be visible any more. ::draw() will do something similar but more conservative - we do this here because ::draw() isn't guaranteed to ever be called! (i.e. the console isn't visible)
+ while ((S32)mParagraphs.size() > llmax((S32)0, (S32)(mMaxLines)))
+ {
+ mParagraphs.pop_front();
+ }
}