[openrtm-commit:02502] r804 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 3月 7日 (火) 16:54:17 JST


Author: miyamoto
Date: 2017-03-07 16:54:17 +0900 (Tue, 07 Mar 2017)
New Revision: 804

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py
   trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
Log:
[compat,bugfix,->RELENG_1_2] fixed bug.

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-02-27 02:50:16 UTC (rev 803)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-03-07 07:54:17 UTC (rev 804)
@@ -129,6 +129,7 @@
     self._initProc   = None
     self._runner     = None
     self._terminator = None
+    self.shutdown_thread = None
     self._compManager = OpenRTM_aist.ObjectManager(self.InstanceName)
     self._factory = OpenRTM_aist.ObjectManager(self.FactoryPredicate)
     self._ecfactory = OpenRTM_aist.ObjectManager(self.ECFactoryPredicate)
@@ -291,6 +292,7 @@
   def shutdown(self):
     self._rtcout.RTC_TRACE("Manager.shutdown()")
     self._listeners.manager_.preShutdown()
+    self.shutdownTimer()
     self.shutdownComponents()
     self.shutdownNaming()
     self.shutdownORB()
@@ -1402,10 +1404,6 @@
   # @endif
   def shutdownManager(self):
     self._rtcout.RTC_TRACE("Manager.shutdownManager()")
-    if self._timer:
-      self._timer.stop()
-      self._timer.join()
-      self._timer = None
 
     return
 
@@ -1435,7 +1433,8 @@
       comps = self.getComponents()
       
       if len(comps) == 0:
-        self.shutdown()
+        self.shutdown_thread = threading.Thread(target=self.shutdown)
+        self.shutdown_thread.start()
 
     return
 
@@ -2046,6 +2045,24 @@
   def initTimer(self):
     return True
 
+  ##
+  # @if jp
+  # @brief Timer の終了
+  #
+  # 使用する各 Timer の終了処理を実行する。
+  #
+  # @param self
+  #
+  # @else
+  #
+  # @endif
+  def shutdownTimer(self):
+    self._rtcout.RTC_TRACE("Manager.shutdownTimer()")
+    if self._timer:
+      self._timer.stop()
+      self._timer.join()
+      self._timer = None
+    
 
   ##
   # @if jp

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py	2017-02-27 02:50:16 UTC (rev 803)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/ManagerServant.py	2017-03-07 07:54:17 UTC (rev 804)
@@ -67,7 +67,7 @@
       self._rtcout.RTC_WARN("Manager CORBA servant creation failed.")
       return
     self._rtcout.RTC_TRACE("Manager CORBA servant was successfully created.")
-
+    
     if OpenRTM_aist.toBool(config.getProperty("manager.is_master"), "YES", "NO", True):
       # this is master manager
       self._rtcout.RTC_TRACE("This manager is master.")

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py	2017-02-27 02:50:16 UTC (rev 803)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/RTObject.py	2017-03-07 07:54:17 UTC (rev 804)
@@ -643,17 +643,21 @@
                                         self.deactivate_comps(self._objref))
 
     # stop and detach myself from owned EC
-    for ec in self._ecMine:
-      if not CORBA.is_nil(ec) or not ec._non_existent():
+    #for ec in self._ecMine:
+    #  if not CORBA.is_nil(ec) or not ec._non_existent():
         # ret = ec.stop()
         # ec.remove_component(self._this())
-        pass
+    #    pass
 
+
     # detach myself from other EC
     for ec in self._ecOther:
-      if not CORBA.is_nil(ec):
-        # ec.stop()
-        ec.remove_component(self._this())
+      try:
+        if not CORBA.is_nil(ec) or not ec._non_existent():
+          # ec.stop()
+          ec.remove_component(self._this())
+      except:
+        pass
         
 
     self._exiting = True



openrtm-commit メーリングリストの案内