mirror of
https://github.com/opensim/opensim.git
synced 2026-05-14 18:55:39 +08:00
Don't re-add the assembly resolver for each script if not creating the appdomain
This commit is contained in:
@@ -1021,11 +1021,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||||||
|
|
||||||
AppDomain sandbox;
|
AppDomain sandbox;
|
||||||
if (m_AppDomainLoading)
|
if (m_AppDomainLoading)
|
||||||
|
{
|
||||||
sandbox = AppDomain.CreateDomain(
|
sandbox = AppDomain.CreateDomain(
|
||||||
m_Scene.RegionInfo.RegionID.ToString(),
|
m_Scene.RegionInfo.RegionID.ToString(),
|
||||||
evidence, appSetup);
|
evidence, appSetup);
|
||||||
|
m_AppDomains[appDomain].AssemblyResolve +=
|
||||||
|
new ResolveEventHandler(
|
||||||
|
AssemblyResolver.OnAssemblyResolve);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
sandbox = AppDomain.CurrentDomain;
|
sandbox = AppDomain.CurrentDomain;
|
||||||
|
}
|
||||||
|
|
||||||
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
|
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
|
||||||
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
|
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
|
||||||
@@ -1037,9 +1044,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||||||
|
|
||||||
m_AppDomains[appDomain] = sandbox;
|
m_AppDomains[appDomain] = sandbox;
|
||||||
|
|
||||||
m_AppDomains[appDomain].AssemblyResolve +=
|
|
||||||
new ResolveEventHandler(
|
|
||||||
AssemblyResolver.OnAssemblyResolve);
|
|
||||||
m_DomainScripts[appDomain] = new List<UUID>();
|
m_DomainScripts[appDomain] = new List<UUID>();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -1984,4 +1988,4 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||||||
// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
|
// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user