Fixed major bug EXT-2608 (Crash: Sometimes LLNavigationBar is trying

to access deleted LLSearchHistory singleton when exiting from viewer).

--HG--
branch : product-engine
master
Andrew Dyukov 2009-11-18 14:25:58 +02:00
parent 215b95eb64
commit 764afa899e
2 changed files with 10 additions and 2 deletions

View File

@ -186,7 +186,6 @@ LLNavigationBar::LLNavigationBar()
LLNavigationBar::~LLNavigationBar()
{
mTeleportFinishConnection.disconnect();
LLSearchHistory::getInstance()->save();
}
BOOL LLNavigationBar::postBuild()

View File

@ -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 @@ protected:
private:
// Implementation of LLDestroyClass<LLSearchHistory>
static void destroyClass()
{
LLSearchHistory::getInstance()->save();
}
search_history_list_t mSearchHistory;
};