From 072a24ad9ac63d34eed0f8ed749344a655e913d1 Mon Sep 17 00:00:00 2001 From: dengg Date: Tue, 24 Jan 2006 21:45:34 +0000 Subject: *** empty log message *** --- .../NodeApplicationManager_Impl.cpp | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp index e30ff5b6773..e4750ad28e9 100644 --- a/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp +++ b/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp @@ -499,12 +499,27 @@ destroyApplication (Deployment::Application_ptr app if (CORBA::is_nil (this->nodeapp_.in () )) ACE_THROW (Deployment::StopError ()); - // If there are no shared components within this NAM, then kill the NA - - // Otherwise, only remove those components from the NA + // Iterate over all the components within this NAM, and if it's + // not a shared component, then remove it. If all the components + // are removed, then we shall kill the NA totally. + bool kill_node_app = true; + for (CORBA::ULong i = 0; i < this->plan_.instance.length (); ++i) + { + ACE_CString name = plan_.instance[i].name.in (); + if (this->is_shared_component (name)) + { + kill_node_app = false; + continue; + } - this->nodeapp_->remove (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + this->nodeapp_->remove_component (name.c_str ()); + } + + if (kill_node_app) + { + this->nodeapp_->remove (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } printf("Exiting NAM_Impl::destroyApplication\n"); return; -- cgit v1.2.1