diff options
author | brad kittenbrink <brad@lindenlab.com> | 2009-07-10 18:29:10 -0700 |
---|---|---|
committer | brad kittenbrink <brad@lindenlab.com> | 2009-07-10 18:29:10 -0700 |
commit | da038e6c8f2f2db10c610337d6aa9a7e8622f3b4 (patch) | |
tree | 38d32fe540c581f7ea49f5527197552146c38fc3 /indra/newview | |
parent | b6fec6f1fc30e6362471d442edda32d841bf30a1 (diff) |
First draft of cleaning up eventhost module on viewer shutdown. Still need to make the whole system more generalized and data driven.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llappviewer.h | 5 |
2 files changed, 23 insertions, 7 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 947f5bdb20..8492644b2d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1154,7 +1154,17 @@ bool LLAppViewer::mainLoop() bool LLAppViewer::cleanup() { - // *TODO - unload event host module here -brad + // *TODO - generalize this and move DSO wrangling to a helper class -brad + std::set<struct apr_dso_handle_t *>::const_iterator i; + for(i = mPlugins.begin(); i != mPlugins.end(); ++i) + { + int (*ll_plugin_stop_func)(void) = NULL; + apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, *i, "ll_plugin_stop"); + ll_plugin_stop_func(); + + rv = apr_dso_unload(*i); + } + mPlugins.clear(); //---------------------------------------------- //this test code will be removed after the test @@ -4098,7 +4108,7 @@ void LLAppViewer::handleLoginComplete() } // *TODO - generalize this and move DSO wrangling to a helper class -brad -void LLAppViewer::loadEventHostModule(S32 listen_port) const +void LLAppViewer::loadEventHostModule(S32 listen_port) { std::string dso_name = #if LL_WINDOWS @@ -4133,9 +4143,12 @@ void LLAppViewer::loadEventHostModule(S32 listen_port) const LLSD args; args["listen_port"] = listen_port; - ll_plugin_start_func(args); + int status = ll_plugin_start_func(args); + + if(status != 0) + { + llwarns << "problem loading eventhost plugin, status: " << status << llendl; + } - args = LLSD(); - args["MESSAGE"] = "EventHost module loaded successfully"; - LLNotifications::instance().add("SystemMessageTip", args); + mPlugins.insert(eventhost_dso_handle); } diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 1227ab470f..69f2a074aa 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -47,6 +47,7 @@ class LLVFS; class LLWatchdogTimeout; class LLWorkerThread; +struct apr_dso_handle_t;
class LLAppViewer : public LLApp @@ -204,7 +205,7 @@ private: void sendLogoutRequest(); void disconnectViewer(); - void loadEventHostModule(S32 listen_port) const; + void loadEventHostModule(S32 listen_port); // *FIX: the app viewer class should be some sort of singleton, no? // Perhaps its child class is the singleton and this should be an abstract base. @@ -251,6 +252,8 @@ private: LLAllocator mAlloc; + std::set<struct apr_dso_handle_t*> mPlugins; + public: //some information for updater typedef struct |