summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp')
-rw-r--r--TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager_Impl.cpp25
1 files 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;