diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-06-15 16:00:24 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-06-15 16:00:24 +0000 |
commit | 6e05756739cdf1ed725a4e239db1c92f0bc95043 (patch) | |
tree | adb26bbe1093e3f63d390537fccefe7927a60520 /cs/src/Ice/ObjectFactoryManager.cs | |
parent | Fixed IceGrid properties (diff) | |
download | ice-6e05756739cdf1ed725a4e239db1c92f0bc95043.tar.bz2 ice-6e05756739cdf1ed725a4e239db1c92f0bc95043.tar.xz ice-6e05756739cdf1ed725a4e239db1c92f0bc95043.zip |
Partial fix bug #472
Diffstat (limited to 'cs/src/Ice/ObjectFactoryManager.cs')
-rwxr-xr-x | cs/src/Ice/ObjectFactoryManager.cs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/cs/src/Ice/ObjectFactoryManager.cs b/cs/src/Ice/ObjectFactoryManager.cs index 97d949ac789..1fa39a36a37 100755 --- a/cs/src/Ice/ObjectFactoryManager.cs +++ b/cs/src/Ice/ObjectFactoryManager.cs @@ -32,9 +32,10 @@ namespace IceInternal public void remove(string id) { + object o = null; lock(this) { - object o = _factoryMap[id]; + o = _factoryMap[id]; if(o == null) { Ice.NotRegisteredException ex = new Ice.NotRegisteredException(); @@ -42,11 +43,9 @@ namespace IceInternal ex.kindOfObject = "object factory"; throw ex; } - - ((Ice.ObjectFactory)o).destroy(); - _factoryMap.Remove(id); } + ((Ice.ObjectFactory)o).destroy(); } public Ice.ObjectFactory find(string id) @@ -67,13 +66,17 @@ namespace IceInternal internal void destroy() { + Hashtable oldMap = null; + lock(this) { - foreach(Ice.ObjectFactory factory in _factoryMap.Values) - { - factory.destroy(); - } - _factoryMap.Clear(); + oldMap = _factoryMap; + _factoryMap = new Hashtable(); + } + + foreach(Ice.ObjectFactory factory in oldMap.Values) + { + factory.destroy(); } } |