fix AbstractObjectFactory's singleton dispose order

* using stable collection and reversing it before traversal
* also remove .gitattributes
This commit is contained in:
Marko Lahma
2014-01-26 09:09:14 +02:00
parent bcaf73332f
commit 9a2907a8a1
2 changed files with 3 additions and 23 deletions

View File

@@ -2466,7 +2466,9 @@ namespace Spring.Objects.Factory.Support
{
// copy the keys into a new set, 'cos we are going to modifying the
// original collection (_singletonCache) as we destroy each singleton.
ISet keys = new HashedSet(singletonCache.Keys);
// we also want to traverse the keys in reverse order to destroy correctly
ArrayList keys = new ArrayList(singletonCache.Keys);
keys.Reverse();
foreach (string name in keys)
{
DestroySingleton(name);