|
From: <jer...@us...> - 2010-02-04 23:30:26
|
Revision: 341
http://structuremap.svn.sourceforge.net/structuremap/?rev=341&view=rev
Author: jeremydmiller
Date: 2010-02-04 23:30:20 +0000 (Thu, 04 Feb 2010)
Log Message:
-----------
Fixing a bug with the Dispose() method on PipelineGraph that only comes into play on a nested container
Modified Paths:
--------------
trunk/Source/StructureMap/InstanceFactory.cs
trunk/Source/StructureMap/PipelineGraph.cs
Modified: trunk/Source/StructureMap/InstanceFactory.cs
===================================================================
--- trunk/Source/StructureMap/InstanceFactory.cs 2010-02-04 13:50:17 UTC (rev 340)
+++ trunk/Source/StructureMap/InstanceFactory.cs 2010-02-04 23:30:20 UTC (rev 341)
@@ -142,8 +142,12 @@
public void Dispose()
{
- _instances.GetAll().Each(i => i.SafeDispose());
_instances.Clear();
}
+
+ public void DisposeInstances()
+ {
+ _instances.GetAll().Each(i => i.SafeDispose());
+ }
}
}
\ No newline at end of file
Modified: trunk/Source/StructureMap/PipelineGraph.cs
===================================================================
--- trunk/Source/StructureMap/PipelineGraph.cs 2010-02-04 13:50:17 UTC (rev 340)
+++ trunk/Source/StructureMap/PipelineGraph.cs 2010-02-04 23:30:20 UTC (rev 341)
@@ -57,10 +57,16 @@
public void Dispose()
{
+ if (_factories.ContainsKey(typeof(IContainer)))
+ {
+ _factories[typeof (IContainer)].AllInstances.Each(x => x.SafeDispose());
+ }
+
foreach (var factory in _factories)
{
factory.Value.Dispose();
}
+
_factories.Clear();
_profileManager.Dispose();
_genericsGraph.ClearAll();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|