diff options
author | Diva Canto | 2010-03-15 19:34:14 -0700 |
---|---|---|
committer | Diva Canto | 2010-03-15 19:34:14 -0700 |
commit | 76106e39d9cd48f136caf061ef9d19641bbdfd31 (patch) | |
tree | 9f310a95e508320a46fc9d91d4b79d2b1f7adaba /OpenSim/Server/Base | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-76106e39d9cd48f136caf061ef9d19641bbdfd31.zip opensim-SC-76106e39d9cd48f136caf061ef9d19641bbdfd31.tar.gz opensim-SC-76106e39d9cd48f136caf061ef9d19641bbdfd31.tar.bz2 opensim-SC-76106e39d9cd48f136caf061ef9d19641bbdfd31.tar.xz |
Restoring LoadPlugin as it was before. Justin's last change made it throw.
Diffstat (limited to 'OpenSim/Server/Base')
-rw-r--r-- | OpenSim/Server/Base/ServerUtils.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index a399672..e7a8294 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs | |||
@@ -101,10 +101,23 @@ namespace OpenSim.Server.Base | |||
101 | continue; | 101 | continue; |
102 | 102 | ||
103 | Type typeInterface = pluginType.GetInterface(interfaceName, true); | 103 | Type typeInterface = pluginType.GetInterface(interfaceName, true); |
104 | 104 | ||
105 | if (typeInterface != null) | 105 | if (typeInterface != null) |
106 | { | 106 | { |
107 | return (T)Activator.CreateInstance(pluginType, args); | 107 | T plug = null; |
108 | try | ||
109 | { | ||
110 | plug = (T)Activator.CreateInstance(pluginType, | ||
111 | args); | ||
112 | } | ||
113 | catch (Exception e) | ||
114 | { | ||
115 | if (!(e is System.MissingMethodException)) | ||
116 | m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException); | ||
117 | return null; | ||
118 | } | ||
119 | |||
120 | return plug; | ||
108 | } | 121 | } |
109 | } | 122 | } |
110 | } | 123 | } |