]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: remove ambiguous prints and catch exceptions on destroy components
authorcaremoli <caremoli>
Thu, 9 Oct 2008 17:32:49 +0000 (17:32 +0000)
committercaremoli <caremoli>
Thu, 9 Oct 2008 17:32:49 +0000 (17:32 +0000)
src/Container/Container_i.cxx
src/Container/SALOME_Container.py
src/Container/SALOME_ContainerPy.py

index 8d0346a99556dac7f63be08c83986da460292215..edf7ca9d7aace3e7d6f78b33153a01a78bf7976d 100644 (file)
@@ -326,7 +326,20 @@ void Engines_Container_i::Shutdown()
   */
   std::map<std::string, Engines::Component_var>::iterator itm;
   for (itm = _listInstances_map.begin(); itm != _listInstances_map.end(); itm++)
-    itm->second->destroy();
+    {
+      try
+        {
+          itm->second->destroy();
+        }
+      catch(const CORBA::Exception& e)
+        {
+          // ignore this entry and continue
+        }
+      catch(...)
+        {
+          // ignore this entry and continue
+        }
+    }
 
   _NS->Destroy_FullDirectory(_containerName.c_str());
   _NS->Destroy_Name(_containerName.c_str());
index 405d1f963f7a7ca2bab7814701b0a9093a11b456..72d1d25be777c8637d3e16eba9bb00730e293542 100644 (file)
@@ -71,14 +71,15 @@ class SALOME_Container_i:
         MESSAGE( "SALOME_Container_i::import_component" )
         ret=0
         try:
-            print "try import ",componentName
+            if verbose(): print "try import ",componentName
             __import__(componentName)
-            print "import ",componentName," successful"
+            if verbose(): print "import ",componentName," successful"
             ret=1
         except:
-            import traceback
-            traceback.print_exc()
-            print "import ",componentName," not possible"
+            if verbose():
+              import traceback
+              traceback.print_exc()
+              print "import ",componentName," not possible"
         return ret
         
     #-------------------------------------------------------------------------
index 41cfcaeee9df9ad9b003044658ecb9045b6ec8d6..f3ce5f66164d77a93ec6ad09de7ba3769464a6c9 100755 (executable)
@@ -176,9 +176,10 @@ class SALOME_ContainerPy_i (Engines__POA.Container):
             if verbose(): print "import ",componentName," successful"
             ret=1
         except:
-            import traceback
-            traceback.print_exc()
-            print "import ",componentName," not possible"
+            if verbose(): 
+              import traceback
+              traceback.print_exc()
+              print "import ",componentName," not possible"
         return ret
 
     #-------------------------------------------------------------------------