From 92c6460e57c3e55f0197f0b9ac7b2a2561591be1 Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Sat, 17 Jul 2010 23:42:24 -0700 Subject: [PATCH] Fix memory leak when running SpecFlow tests As a workaround for nunit reporting obscure AppDomainUnloadedException, update the .config file to disable lagacy exception handling policy. --HG-- branch : dev --- lib/nunit/nunit-console.exe.config | 2 +- src/Orchard.Specs/Hosting/WebHostAgent.cs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/nunit/nunit-console.exe.config b/lib/nunit/nunit-console.exe.config index f1af50101..3d5420463 100644 --- a/lib/nunit/nunit-console.exe.config +++ b/lib/nunit/nunit-console.exe.config @@ -29,7 +29,7 @@ - + diff --git a/src/Orchard.Specs/Hosting/WebHostAgent.cs b/src/Orchard.Specs/Hosting/WebHostAgent.cs index 919180a62..eb2a41726 100644 --- a/src/Orchard.Specs/Hosting/WebHostAgent.cs +++ b/src/Orchard.Specs/Hosting/WebHostAgent.cs @@ -1,5 +1,8 @@ using System; +using System.Threading; +using System.Web; using System.Web.Hosting; +using Orchard.Specs.Hosting.Orchard.Web; namespace Orchard.Specs.Hosting { public class WebHostAgent : MarshalByRefObject @@ -11,11 +14,7 @@ namespace Orchard.Specs.Hosting { } public void Shutdown() { - //TODO: this line is required to properly shutdown the ASP.NET - // host and release memory when running multiple SpecFlow tests. - // However, nuint complains about an unhandled AppdomainUnloadedException - // When we figure out a way around this, we will re-enable this line. - //HostingEnvironment.InitiateShutdown(); + HostingEnvironment.InitiateShutdown(); } } }