[openrtm-commit:00569] r2274 - trunk/OpenRTM-aist/src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 1月 11日 (水) 02:22:00 JST
Author: n-ando
Date: 2012-01-11 02:22:00 +0900 (Wed, 11 Jan 2012)
New Revision: 2274
Modified:
trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
trunk/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: trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2012-01-10 17:13:36 UTC (rev 2273)
+++ trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2012-01-10 17:22:00 UTC (rev 2274)
@@ -114,20 +114,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;
}
@@ -138,26 +138,26 @@
* @else
* @brief Get instance of the manager
* @endif
- */
+ */
Manager& Manager::instance()
{
// 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: trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp 2012-01-10 17:13:36 UTC (rev 2273)
+++ trunk/OpenRTM-aist/src/lib/rtm/ManagerServant.cpp 2012-01-10 17:22:00 UTC (rev 2274)
@@ -426,8 +426,22 @@
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;
}
openrtm-commit メーリングリストの案内