From 75138ddfb27416b8740df35fcc0eb6ed3643452f Mon Sep 17 00:00:00 2001
From: James Cook <james@lindenlab.com>
Date: Fri, 20 Nov 2009 10:46:58 -0800
Subject: [PATCH] Fix main loop to llerrs on memory alloc failure, was masked
 by misuse of LLFLoaterReg with LLFloaterMemLeak. Reviewed with Bao

---
 indra/newview/llappviewer.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index a5ca06ce306..4f2d3e96455 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -985,7 +985,8 @@ bool LLAppViewer::mainLoop()
 			
 #endif
 			//memory leaking simulation
-			LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::getTypedInstance<LLFloaterMemLeak>("mem_leaking");
+			LLFloaterMemLeak* mem_leak_instance =
+				LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking");
 			if(mem_leak_instance)
 			{
 				mem_leak_instance->idle() ;				
@@ -1171,7 +1172,8 @@ bool LLAppViewer::mainLoop()
 		catch(std::bad_alloc)
 		{			
 			//stop memory leaking simulation
-			LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::getTypedInstance<LLFloaterMemLeak>("mem_leaking");
+			LLFloaterMemLeak* mem_leak_instance =
+				LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking");
 			if(mem_leak_instance)
 			{
 				mem_leak_instance->stop() ;				
@@ -1199,7 +1201,8 @@ bool LLAppViewer::mainLoop()
 			llwarns << "Bad memory allocation when saveFinalSnapshot() is called!" << llendl ;
 
 			//stop memory leaking simulation
-			LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::getTypedInstance<LLFloaterMemLeak>("mem_leaking");
+			LLFloaterMemLeak* mem_leak_instance =
+				LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking");
 			if(mem_leak_instance)
 			{
 				mem_leak_instance->stop() ;				
-- 
GitLab