diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-04-29 18:17:14 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-04-29 18:17:14 +0000 |
commit | 19b5869472e679fb244709a53a1bb8b79ec5186f (patch) | |
tree | f65bbf8032a89f96a3c55c468d00e04a7e43edf5 /java/src/IceInternal/ObjectAdapterFactory.java | |
parent | Added call to srand48() (diff) | |
download | ice-19b5869472e679fb244709a53a1bb8b79ec5186f.tar.bz2 ice-19b5869472e679fb244709a53a1bb8b79ec5186f.tar.xz ice-19b5869472e679fb244709a53a1bb8b79ec5186f.zip |
- Removing BufferManager class and BasicStream.destroy(), which reduces the
complexity of many existing finalizers.
- Removed code that cleans up cached objects.
- For compatibility with C#, finalizers no longer call methods on other
objects.
Diffstat (limited to 'java/src/IceInternal/ObjectAdapterFactory.java')
-rw-r--r-- | java/src/IceInternal/ObjectAdapterFactory.java | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/java/src/IceInternal/ObjectAdapterFactory.java b/java/src/IceInternal/ObjectAdapterFactory.java index 7caa17ef2b7..f570684cbd0 100644 --- a/java/src/IceInternal/ObjectAdapterFactory.java +++ b/java/src/IceInternal/ObjectAdapterFactory.java @@ -75,17 +75,24 @@ public final class ObjectAdapterFactory // // Now we wait for deactivation of each object adapter. // - java.util.Iterator i = _adapters.values().iterator(); - while(i.hasNext()) - { - Ice.ObjectAdapter adapter = (Ice.ObjectAdapter)i.next(); - adapter.waitForDeactivate(); - } - - // - // We're done, now we can throw away the object adapters. - // - _adapters.clear(); + if(_adapters != null) + { + java.util.Iterator i = _adapters.values().iterator(); + while(i.hasNext()) + { + Ice.ObjectAdapter adapter = (Ice.ObjectAdapter)i.next(); + adapter.waitForDeactivate(); + } + + // + // We're done, now we can throw away the object adapters. + // + // For consistency with C#, we set _adapters to null + // so that our finalizer does not try to invoke any + // methods on member objects. + // + _adapters = null; + } synchronized(this) { @@ -179,7 +186,7 @@ public final class ObjectAdapterFactory { assert(_instance == null); assert(_communicator == null); - assert(_adapters.size() == 0); + assert(_adapters == null); assert(!_waitForShutdown); super.finalize(); |