destroy updater state machine if login instance destroyed.

master
Andrew A. de Laix 2010-12-10 11:03:34 -08:00
parent b89b41991e
commit 7887bdfd5c
2 changed files with 13 additions and 2 deletions

View File

@ -64,8 +64,15 @@
#include <boost/scoped_ptr.hpp>
#include <sstream>
class LLLoginInstance::Disposable {
public:
virtual ~Disposable() {}
};
namespace {
class MandatoryUpdateMachine {
class MandatoryUpdateMachine:
public LLLoginInstance::Disposable
{
public:
MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService);
@ -754,6 +761,7 @@ void LLLoginInstance::updateApp(bool mandatory, const std::string& auth_msg)
{
gViewerWindow->setShowProgress(false);
MandatoryUpdateMachine * machine = new MandatoryUpdateMachine(*this, *mUpdaterService);
mUpdateStateMachine.reset(machine);
machine->start();
return;
}

View File

@ -41,6 +41,8 @@ class LLUpdaterService;
class LLLoginInstance : public LLSingleton<LLLoginInstance>
{
public:
class Disposable;
LLLoginInstance();
~LLLoginInstance();
@ -106,7 +108,8 @@ private:
int mLastExecEvent;
UpdaterLauncherCallback mUpdaterLauncher;
LLEventDispatcher mDispatcher;
LLUpdaterService * mUpdaterService;
LLUpdaterService * mUpdaterService;
boost::scoped_ptr<Disposable> mUpdateStateMachine;
};
#endif