From 764afa899ee3a4b2f1fa1f32c13a918c2caad9a9 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Wed, 18 Nov 2009 14:25:58 +0200 Subject: Fixed major bug EXT-2608 (Crash: Sometimes LLNavigationBar is trying to access deleted LLSearchHistory singleton when exiting from viewer). --HG-- branch : product-engine --- indra/newview/llnavigationbar.cpp | 1 - indra/newview/llsearchhistory.h | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 794d73a5ad..a770fe15fb 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 253ef21e9e..eb6efdb86f 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 +class LLSearchHistory : public LLSingleton, private LLDestroyClass { + friend class LLDestroyClass; public: // Forward declaration @@ -130,6 +133,12 @@ protected: private: + // Implementation of LLDestroyClass + static void destroyClass() + { + LLSearchHistory::getInstance()->save(); + } + search_history_list_t mSearchHistory; }; -- cgit v1.2.3