diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 0c2782fd8a08293726665901087230e2d349affc..114d26af8aac017377f76135f46be411a4442118 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -186,7 +186,6 @@ LLNavigationBar::LLNavigationBar()
 LLNavigationBar::~LLNavigationBar()
 {
 	mTeleportFinishConnection.disconnect();
-	LLSearchHistory::getInstance()->save();
 }
 
 BOOL LLNavigationBar::postBuild()
diff --git a/indra/newview/llsearchhistory.h b/indra/newview/llsearchhistory.h
index 253ef21e9e182a50e0fccbd17adf4444a521a374..eb6efdb86f2a5f1888ba738225e7f2e4a79d896e 100644
--- a/indra/newview/llsearchhistory.h
+++ b/indra/newview/llsearchhistory.h
@@ -34,12 +34,15 @@
 #define LL_LLSEARCHHISTORY_H
 
 #include "llsingleton.h"
+#include "llui.h"
+
 /**
  * Search history container able to save and load history from file.
  * History is stored in chronological order, most recent at the beginning.
  */
-class LLSearchHistory : public LLSingleton<LLSearchHistory>
+class LLSearchHistory : public LLSingleton<LLSearchHistory>, private LLDestroyClass<LLSearchHistory>
 {
+	friend class LLDestroyClass<LLSearchHistory>;
 public:
 
 	// Forward declaration
@@ -130,6 +133,12 @@ class LLSearchHistory : public LLSingleton<LLSearchHistory>
 
 private:
 
+	// Implementation of LLDestroyClass<LLSearchHistory>
+	static void destroyClass()
+	{
+		LLSearchHistory::getInstance()->save();
+	}
+
 	search_history_list_t mSearchHistory;
 };