diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-05-02 21:16:46 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-05-02 21:16:46 +0000 |
commit | 82f86d5b9c7199810bf61b996294d5af10f24f12 (patch) | |
tree | 7be2f61fa23e36531ebaa5f51ad0ff19e90d4124 /cs/src/Ice/ObjectAdapterFactory.cs | |
parent | Added entry (diff) | |
download | ice-82f86d5b9c7199810bf61b996294d5af10f24f12.tar.bz2 ice-82f86d5b9c7199810bf61b996294d5af10f24f12.tar.xz ice-82f86d5b9c7199810bf61b996294d5af10f24f12.zip |
merging finalizer, stream changes from 2_1_branch
Diffstat (limited to 'cs/src/Ice/ObjectAdapterFactory.cs')
-rwxr-xr-x | cs/src/Ice/ObjectAdapterFactory.cs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/cs/src/Ice/ObjectAdapterFactory.cs b/cs/src/Ice/ObjectAdapterFactory.cs index b3051e51772..c5203b0240c 100755 --- a/cs/src/Ice/ObjectAdapterFactory.cs +++ b/cs/src/Ice/ObjectAdapterFactory.cs @@ -63,20 +63,26 @@ namespace IceInternal } _waitForShutdown = true; } - + // // Now we wait for deactivation of each object adapter. // - foreach(Ice.ObjectAdapter adapter in _adapters.Values) + if(_adapters != null) { - adapter.waitForDeactivate(); + foreach(Ice.ObjectAdapter adapter in _adapters.Values) + { + adapter.waitForDeactivate(); + } + + // + // We're done, now we can throw away the object adapters. + // + // We set _adapters to null because our destructor must not + // invoke methods on member objects. + // + _adapters = null; } - // - // We're done, now we can throw away the object adapters. - // - _adapters.Clear(); - lock(this) { // @@ -172,7 +178,7 @@ namespace IceInternal { IceUtil.Assert.FinalizerAssert(_instance == null); IceUtil.Assert.FinalizerAssert(_communicator == null); - IceUtil.Assert.FinalizerAssert(_adapters != null); + IceUtil.Assert.FinalizerAssert(_adapters == null); IceUtil.Assert.FinalizerAssert(!_waitForShutdown); } } |