* One More thing, add an appdomain data element to ensure that we don't duplicate the assembly resolving.

link-sitting
Fernando Oliveira 2013-10-16 21:20:11 -05:00 committed by fernando
parent 8fdf70b87e
commit f83343d302
2 changed files with 15 additions and 4 deletions

View File

@ -58,10 +58,16 @@ namespace OpenSim.Data.PGSQL
{ {
if (!Util.IsPlatformMono) if (!Util.IsPlatformMono)
{ {
if (AppDomain.CurrentDomain.GetData("MonoSecurityPostgresAdded") == null)
{
AppDomain.CurrentDomain.SetData("MonoSecurityPostgresAdded", "true");
AppDomain currentDomain = AppDomain.CurrentDomain; AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec);
} }
} }
}
private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args)
{ {

View File

@ -64,10 +64,15 @@ namespace OpenSim.Data.PGSQL
{ {
if (!Util.IsPlatformMono) if (!Util.IsPlatformMono)
{ {
if (AppDomain.CurrentDomain.GetData("MonoSecurityPostgresAdded") == null)
{
AppDomain.CurrentDomain.SetData("MonoSecurityPostgresAdded", "true");
AppDomain currentDomain = AppDomain.CurrentDomain; AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec);
} }
} }
}
private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args)
{ {