From f83343d3022d568f4fdbbfa79fee867ba4d2e9ec Mon Sep 17 00:00:00 2001 From: Fernando Oliveira Date: Wed, 16 Oct 2013 21:20:11 -0500 Subject: [PATCH] * One More thing, add an appdomain data element to ensure that we don't duplicate the assembly resolving. --- OpenSim/Data/PGSQL/PGSQLFramework.cs | 10 ++++++++-- OpenSim/Data/PGSQL/PGSQLManager.cs | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/OpenSim/Data/PGSQL/PGSQLFramework.cs b/OpenSim/Data/PGSQL/PGSQLFramework.cs index 48f8dd379f..1028e4ea86 100644 --- a/OpenSim/Data/PGSQL/PGSQLFramework.cs +++ b/OpenSim/Data/PGSQL/PGSQLFramework.cs @@ -58,8 +58,14 @@ namespace OpenSim.Data.PGSQL { if (!Util.IsPlatformMono) { - AppDomain currentDomain = AppDomain.CurrentDomain; - currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); + + if (AppDomain.CurrentDomain.GetData("MonoSecurityPostgresAdded") == null) + { + AppDomain.CurrentDomain.SetData("MonoSecurityPostgresAdded", "true"); + + AppDomain currentDomain = AppDomain.CurrentDomain; + currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); + } } } diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index 2084fe9ce8..97f40b260b 100644 --- a/OpenSim/Data/PGSQL/PGSQLManager.cs +++ b/OpenSim/Data/PGSQL/PGSQLManager.cs @@ -64,8 +64,13 @@ namespace OpenSim.Data.PGSQL { if (!Util.IsPlatformMono) { - AppDomain currentDomain = AppDomain.CurrentDomain; - currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); + if (AppDomain.CurrentDomain.GetData("MonoSecurityPostgresAdded") == null) + { + AppDomain.CurrentDomain.SetData("MonoSecurityPostgresAdded", "true"); + + AppDomain currentDomain = AppDomain.CurrentDomain; + currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); + } } }