summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp11
-rw-r--r--indra/llui/llview.cpp2
2 files changed, 11 insertions, 2 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 9a07712757..915b0427ba 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1116,8 +1116,19 @@ void LLTextBase::reflow()
updateSegments();
+ S32 reflow_count = 0;
while(mReflowIndex < S32_MAX)
{
+ // we can get into an infinite loop if the document height does not monotonically increase
+ // with decreasing width (embedded ui elements with alternate layouts). In that case,
+ // we want to stop reflowing after 2 iterations. We use 2, since we need to handle the case
+ // of introducing a vertical scrollbar causing a reflow with less width. We should also always
+ // use an even number of iterations to avoid user visible oscillation of the layout
+ if(++reflow_count > 2)
+ {
+ lldebugs << "Breaking out of reflow due to possible infinite loop in " << getName() << llendl;
+ break;
+ }
S32 start_index = mReflowIndex;
mReflowIndex = S32_MAX;
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index c091686ffb..bd56da9121 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -1319,8 +1319,6 @@ void LLView::drawChildren()
if (viewp->getVisible() && viewp->getRect().isValid())
{
- // check for bad data
- llassert_always(viewp->getVisible() == TRUE);
// Only draw views that are within the root view
localRectToScreen(viewp->getRect(),&screenRect);
if ( rootRect.overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect))