From e75a4ffb6ae085c941e1e1b779e987de0e6c80b6 Mon Sep 17 00:00:00 2001
From: richard <none@none>
Date: Fri, 5 Feb 2010 14:20:27 -0800
Subject: [PATCH] EXT-5026 - Crash when exiting from login screen

reviewed by Mani
---
 indra/newview/llappviewer.cpp    | 3 ---
 indra/newview/llviewerwindow.cpp | 6 +++++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f2b3c7826c9..a3720769a1f 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1353,9 +1353,6 @@ bool LLAppViewer::cleanup()
 
 	llinfos << "Cache files removed" << llendflush;
 
-
-	cleanup_menus();
-
 	// Wait for any pending VFS IO
 	while (1)
 	{
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 315b7c52cff..4a86e1ca412 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1726,7 +1726,11 @@ void LLViewerWindow::shutdownViews()
 	// destroy the nav bar, not currently part of gViewerWindow
 	// *TODO: Make LLNavigationBar part of gViewerWindow
 	delete LLNavigationBar::getInstance();
-	
+
+	// destroy menus after instantiating navbar above, as it needs
+	// access to gMenuHolder
+	cleanup_menus();
+
 	// Delete all child views.
 	delete mRootView;
 	mRootView = NULL;
-- 
GitLab