Update bootstrappers to dispose their containers

This commit is contained in:
Antony Male 2015-01-14 12:23:43 +00:00
parent e119386335
commit 5e40db124d
6 changed files with 31 additions and 0 deletions

View File

@ -2,6 +2,7 @@
using Stylet;
using System;
using System.Linq;
using System.Windows;
namespace Bootstrappers
{
@ -46,5 +47,10 @@ namespace Bootstrappers
{
return this.container.Resolve(type);
}
protected override void OnExitInternal(ExitEventArgs e)
{
this.container.Dispose();
}
}
}

View File

@ -54,6 +54,7 @@
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="StructureMap">
<HintPath>packages\structuremap.3.1.4.143\lib\net40\StructureMap.dll</HintPath>
</Reference>

View File

@ -3,6 +3,7 @@ using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Stylet;
using System;
using System.Windows;
namespace Bootstrappers
{
@ -52,5 +53,10 @@ namespace Bootstrappers
{
return this.container.Resolve(type);
}
protected override void OnExitInternal(ExitEventArgs e)
{
this.container.Dispose();
}
}
}

View File

@ -1,6 +1,7 @@
using Ninject;
using Stylet;
using System;
using System.Windows;
namespace Bootstrappers
{
@ -43,5 +44,10 @@ namespace Bootstrappers
{
return this.kernel.Get(type);
}
protected override void OnExitInternal(ExitEventArgs e)
{
this.kernel.Dispose();
}
}
}

View File

@ -2,6 +2,7 @@
using StructureMap.Pipeline;
using Stylet;
using System;
using System.Windows;
namespace Bootstrappers
{
@ -50,5 +51,10 @@ namespace Bootstrappers
{
return this.container.GetInstance(type);
}
protected override void OnExitInternal(ExitEventArgs e)
{
this.container.Dispose();
}
}
}

View File

@ -1,6 +1,7 @@
using Microsoft.Practices.Unity;
using Stylet;
using System;
using System.Windows;
namespace Bootstrappers
{
@ -46,6 +47,11 @@ namespace Bootstrappers
{
return this.container.Resolve(type);
}
protected override void OnExitInternal(ExitEventArgs e)
{
this.container.Dispose();
}
}
}