[openrtm-commit:00567] r2272 - branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 1月 11日 (水) 02:10:41 JST
Author: n-ando
Date: 2012-01-11 02:10:38 +0900 (Wed, 11 Jan 2012)
New Revision: 2272
Modified:
branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/Manager.cpp
branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp
Log:
[compat change] ManagerServant::delete_component() has been changed. Now it just call RTC's exit() function, instead of calling Manager's deleteComp().
[compat change] Manager::instance() function now calls initManagerServant(). Bug.
Modified: branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/Manager.cpp
===================================================================
--- branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/Manager.cpp 2012-01-09 13:32:18 UTC (rev 2271)
+++ branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/Manager.cpp 2012-01-10 17:10:38 UTC (rev 2272)
@@ -111,20 +111,20 @@
// DCL for singleton
if (!manager)
{
- Guard guard(mutex);
- if (!manager)
- {
- manager = new Manager();
- manager->initManager(argc, argv);
- manager->initLogger();
- manager->initORB();
- manager->initNaming();
+ Guard guard(mutex);
+ if (!manager)
+ {
+ manager = new Manager();
+ manager->initManager(argc, argv);
+ manager->initLogger();
+ manager->initORB();
+ manager->initNaming();
manager->initFactories();
- manager->initExecContext();
- manager->initComposite();
- manager->initTimer();
+ manager->initExecContext();
+ manager->initComposite();
+ manager->initTimer();
manager->initManagerServant();
- }
+ }
}
return manager;
}
@@ -141,19 +141,20 @@
// DCL for singleton
if (!manager)
{
- Guard guard(mutex);
- if (!manager)
- {
- manager = new Manager();
- manager->initManager(0, NULL);
- manager->initLogger();
- manager->initORB();
- manager->initNaming();
+ Guard guard(mutex);
+ if (!manager)
+ {
+ manager = new Manager();
+ manager->initManager(0, NULL);
+ manager->initLogger();
+ manager->initORB();
+ manager->initNaming();
manager->initFactories();
- manager->initExecContext();
- manager->initComposite();
- manager->initTimer();
- }
+ manager->initExecContext();
+ manager->initComposite();
+ manager->initTimer();
+ manager->initManagerServant();
+ }
}
return *manager;
}
Modified: branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp
===================================================================
--- branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp 2012-01-09 13:32:18 UTC (rev 2271)
+++ branches/RELENG_1_0/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp 2012-01-10 17:10:38 UTC (rev 2272)
@@ -414,11 +414,25 @@
RTC::ReturnCode_t ManagerServant::delete_component(const char* instance_name)
{
RTC_TRACE(("delete_component(%s)", instance_name));
-
- m_mgr.deleteComponent(instance_name);
+
+ RTC::RTObject_impl* comp = m_mgr.getComponent(instance_name);
+ if (comp == NULL)
+ {
+ RTC_WARN(("No such component exists: %s", instance_name));
+ return RTC::BAD_PARAMETER;
+ }
+ try
+ {
+ comp->exit();
+ }
+ catch (...)
+ { // never come here
+ RTC_ERROR(("Unknown exception was raised, when RTC was finalized."));
+ return RTC::RTC_ERROR;
+ }
return ::RTC::RTC_OK;
}
-
+
/*!
* @if jp
* @brief 起動中のコンポーネントのリストを取得する
openrtm-commit メーリングリストの案内