From ff64af596bbd7fb50d3c28208e863eaf83b0a376 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 5 Jul 2011 17:54:25 -0700 Subject: Applied 0001-Fix-hang-in-LLFloater-getClosableFloaterFromFocus-2..patch by Makomk Makosen for #763: Possible infinite loop in LLFloater::getClosableFloaterFromFocus --- linden/indra/llui/llfloater.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index bb42ca3..58c717a 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -1368,6 +1368,7 @@ LLFloater* LLFloater::getClosableFloaterFromFocus() // The focused floater may not be closable, // Find and close a parental floater that is closeable, if any. + LLFloater* prev_floater = NULL; for(LLFloater* floater_to_close = focused_floater; NULL != floater_to_close; floater_to_close = gFloaterView->getParentFloater(floater_to_close)) @@ -1376,6 +1377,15 @@ LLFloater* LLFloater::getClosableFloaterFromFocus() { return floater_to_close; } + + // If floater has as parent root view + // gFloaterView->getParentFloater(floater_to_close) returns + // the same floater_to_close, so we need to check this. + if (prev_floater == floater_to_close) + { + break; + } + prev_floater = floater_to_close; } return NULL; -- cgit v1.1