summaryrefslogtreecommitdiff
path: root/indra/llplugin/llplugininstance.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-02-09 20:18:26 -0800
committerMerov Linden <merov@lindenlab.com>2011-02-09 20:18:26 -0800
commit76cb9a7796ffce930458aae00147f8dafa4b33fb (patch)
treec9553396094aba4608da58662e5383c009423d2e /indra/llplugin/llplugininstance.cpp
parentb82f2c4e4d8c4b9a349e4cd933dff7a0844019c0 (diff)
parent0ea1b472c636415a48b8cc688ec9b7663be6dc9d (diff)
STORM-986 : pull into viewer-development
Diffstat (limited to 'indra/llplugin/llplugininstance.cpp')
-rw-r--r--indra/llplugin/llplugininstance.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp
index c326961db4..7cde82a20e 100644
--- a/indra/llplugin/llplugininstance.cpp
+++ b/indra/llplugin/llplugininstance.cpp
@@ -32,6 +32,10 @@
#include "llapr.h"
+#if LL_WINDOWS
+#include "direct.h" // needed for _chdir()
+#endif
+
/** Virtual destructor. */
LLPluginInstanceMessageListener::~LLPluginInstanceMessageListener()
{
@@ -73,10 +77,24 @@ LLPluginInstance::~LLPluginInstance()
* @param[in] plugin_file Name of plugin dll/dylib/so. TODO:DOC is this correct? see .h
* @return 0 if successful, APR error code or error code from the plugin's init function on failure.
*/
-int LLPluginInstance::load(std::string &plugin_file)
+int LLPluginInstance::load(const std::string& plugin_dir, std::string &plugin_file)
{
pluginInitFunction init_function = NULL;
+ if ( plugin_dir.length() )
+ {
+#if LL_WINDOWS
+ // VWR-21275:
+ // *SOME* Windows systems fail to load the Qt plugins if the current working
+ // directory is not the same as the directory with the Qt DLLs in.
+ // This should not cause any run time issues since we are changing the cwd for the
+ // plugin shell process and not the viewer.
+ // Changing back to the previous directory is not necessary since the plugin shell
+ // quits once the plugin exits.
+ _chdir( plugin_dir.c_str() );
+#endif
+ };
+
int result = apr_dso_load(&mDSOHandle,
plugin_file.c_str(),
gAPRPoolp);