summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp2
-rw-r--r--indra/newview/llappviewerlistener.cpp17
-rw-r--r--indra/newview/llappviewerlistener.h7
3 files changed, 16 insertions, 10 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 4cb3b92476..5b769dcab4 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -205,7 +205,7 @@
#pragma warning (disable:4702)
#endif
-static LLAppViewerListener sAppViewerListener("LLAppViewer", NULL);
+static LLAppViewerListener sAppViewerListener("LLAppViewer", LLAppViewer::instance);
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
//
diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp
index a3af251a3c..3259309eee 100644
--- a/indra/newview/llappviewerlistener.cpp
+++ b/indra/newview/llappviewerlistener.cpp
@@ -19,19 +19,22 @@
// other Linden headers
#include "llappviewer.h"
-LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, LLAppViewer* llappviewer):
+LLAppViewerListener::LLAppViewerListener(const std::string& pumpname,
+ const LLAppViewerGetter& getter):
LLDispatchListener(pumpname, "op"),
- mAppViewer(llappviewer)
+ mAppViewerGetter(getter)
{
// add() every method we want to be able to invoke via this event API.
add("requestQuit", &LLAppViewerListener::requestQuit);
+ add("forceQuit", &LLAppViewerListener::forceQuit);
}
void LLAppViewerListener::requestQuit(const LLSD& event)
{
- if(mAppViewer == NULL)
- {
- mAppViewer = LLAppViewer::instance();
- }
- mAppViewer->requestQuit();
+ mAppViewerGetter()->requestQuit();
+}
+
+void LLAppViewerListener::forceQuit(const LLSD& event)
+{
+ mAppViewerGetter()->forceQuit();
}
diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h
index d702f605ef..73227cb95a 100644
--- a/indra/newview/llappviewerlistener.h
+++ b/indra/newview/llappviewerlistener.h
@@ -13,6 +13,7 @@
#define LL_LLAPPVIEWERLISTENER_H
#include "lleventdispatcher.h"
+#include <boost/function.hpp>
class LLAppViewer;
class LLSD;
@@ -21,14 +22,16 @@ class LLSD;
class LLAppViewerListener: public LLDispatchListener
{
public:
+ typedef boost::function<LLAppViewer*(void)> LLAppViewerGetter;
/// Specify the pump name on which to listen, and bind the LLAppViewer
/// instance to use (e.g. LLAppViewer::instance()).
- LLAppViewerListener(const std::string& pumpname, LLAppViewer* llappviewer);
+ LLAppViewerListener(const std::string& pumpname, const LLAppViewerGetter& getter);
private:
void requestQuit(const LLSD& event);
+ void forceQuit(const LLSD& event);
- LLAppViewer* mAppViewer;
+ LLAppViewerGetter mAppViewerGetter;
};
#endif /* ! defined(LL_LLAPPVIEWERLISTENER_H) */