|
From: <jer...@us...> - 2009-07-07 19:00:53
|
Revision: 254
http://structuremap.svn.sourceforge.net/structuremap/?rev=254&view=rev
Author: jeremydmiller
Date: 2009-07-07 19:00:49 +0000 (Tue, 07 Jul 2009)
Log Message:
-----------
Patching a memory leak with StructureMap
Modified Paths:
--------------
trunk/Source/StructureMap/Container.cs
trunk/Source/StructureMap/Graph/GenericsPluginGraph.cs
trunk/Source/StructureMap/Pipeline/Profile.cs
trunk/Source/StructureMap/Pipeline/ProfileManager.cs
trunk/Source/StructureMap/PipelineGraph.cs
Modified: trunk/Source/StructureMap/Container.cs
===================================================================
--- trunk/Source/StructureMap/Container.cs 2009-07-04 17:45:11 UTC (rev 253)
+++ trunk/Source/StructureMap/Container.cs 2009-07-07 19:00:49 UTC (rev 254)
@@ -459,6 +459,7 @@
public void Dispose()
{
_transientCache.DisposeAndClear();
+ _pipelineGraph.ClearAll();
}
#endregion
Modified: trunk/Source/StructureMap/Graph/GenericsPluginGraph.cs
===================================================================
--- trunk/Source/StructureMap/Graph/GenericsPluginGraph.cs 2009-07-04 17:45:11 UTC (rev 253)
+++ trunk/Source/StructureMap/Graph/GenericsPluginGraph.cs 2009-07-07 19:00:49 UTC (rev 254)
@@ -170,5 +170,10 @@
{
return _families.Has(pluginType);
}
+
+ public void ClearAll()
+ {
+ _families.Clear();
+ }
}
}
\ No newline at end of file
Modified: trunk/Source/StructureMap/Pipeline/Profile.cs
===================================================================
--- trunk/Source/StructureMap/Pipeline/Profile.cs 2009-07-04 17:45:11 UTC (rev 253)
+++ trunk/Source/StructureMap/Pipeline/Profile.cs 2009-07-07 19:00:49 UTC (rev 254)
@@ -110,5 +110,10 @@
{
_instances.Remove(typeof (T));
}
+
+ public void Clear()
+ {
+ _instances.Clear();
+ }
}
}
\ No newline at end of file
Modified: trunk/Source/StructureMap/Pipeline/ProfileManager.cs
===================================================================
--- trunk/Source/StructureMap/Pipeline/ProfileManager.cs 2009-07-04 17:45:11 UTC (rev 253)
+++ trunk/Source/StructureMap/Pipeline/ProfileManager.cs 2009-07-07 19:00:49 UTC (rev 254)
@@ -245,5 +245,17 @@
pair.Value.Remove<T>();
}
}
+
+ public void ClearAll()
+ {
+ _currentProfile.Clear();
+ _machineProfile.Clear();
+ _default.Clear();
+
+ foreach (var profile in _profiles)
+ {
+ profile.Value.Clear();
+ }
+ }
}
}
\ No newline at end of file
Modified: trunk/Source/StructureMap/PipelineGraph.cs
===================================================================
--- trunk/Source/StructureMap/PipelineGraph.cs 2009-07-04 17:45:11 UTC (rev 253)
+++ trunk/Source/StructureMap/PipelineGraph.cs 2009-07-07 19:00:49 UTC (rev 254)
@@ -231,5 +231,12 @@
{
return ForType(pluginType).FindInstance(instanceKey) != null;
}
+
+ public void ClearAll()
+ {
+ _factories.Clear();
+ _profileManager.ClearAll();
+ _genericsGraph.ClearAll();
+ }
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|