diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-01-05 18:44:54 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-01-05 18:44:54 +0000 |
commit | f6e5f4fa31eb7ca5ae0c6301b579da2752606950 (patch) | |
tree | 6198903725faacfb92fa6758a3b65a9812ff41ab /cs/src/Ice/ObjectAdapterFactory.cs | |
parent | fix header file symlink target location for db45 (diff) | |
download | ice-f6e5f4fa31eb7ca5ae0c6301b579da2752606950.tar.bz2 ice-f6e5f4fa31eb7ca5ae0c6301b579da2752606950.tar.xz ice-f6e5f4fa31eb7ca5ae0c6301b579da2752606950.zip |
Added ObjectAdapter::destroy
Diffstat (limited to 'cs/src/Ice/ObjectAdapterFactory.cs')
-rwxr-xr-x | cs/src/Ice/ObjectAdapterFactory.cs | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/cs/src/Ice/ObjectAdapterFactory.cs b/cs/src/Ice/ObjectAdapterFactory.cs index b62f73e40a2..2f561decbc4 100755 --- a/cs/src/Ice/ObjectAdapterFactory.cs +++ b/cs/src/Ice/ObjectAdapterFactory.cs @@ -81,14 +81,6 @@ namespace IceInternal { 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; } lock(this) @@ -100,6 +92,32 @@ namespace IceInternal System.Threading.Monitor.PulseAll(this); } } + + public void destroy() + { + // + // First wait for shutdown to finish. + // + waitForShutdown(); + + Hashtable adapters; + + lock(this) + { + adapters = _adapters; + + // + // We set _adapters to null because our destructor must not + // invoke methods on member objects. + // + _adapters = null; + } + + foreach(Ice.ObjectAdapter adapter in adapters.Values) + { + adapter.destroy(); + } + } public Ice.ObjectAdapter createObjectAdapter(string name, string endpoints, Ice.RouterPrx router) { @@ -175,7 +193,7 @@ namespace IceInternal { lock(this) { - if(_waitForShutdown) + if(_waitForShutdown || _adapters == null) { return; } |