From 2c217e94191f268965bb225773b22c0a1200b828 Mon Sep 17 00:00:00 2001 From: caremoli Date: Thu, 9 Oct 2008 17:32:49 +0000 Subject: [PATCH] CCAR: remove ambiguous prints and catch exceptions on destroy components --- src/Container/Container_i.cxx | 15 ++++++++++++++- src/Container/SALOME_Container.py | 11 ++++++----- src/Container/SALOME_ContainerPy.py | 7 ++++--- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 8d0346a99..edf7ca9d7 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -326,7 +326,20 @@ void Engines_Container_i::Shutdown() */ std::map::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()); diff --git a/src/Container/SALOME_Container.py b/src/Container/SALOME_Container.py index 405d1f963..72d1d25be 100644 --- a/src/Container/SALOME_Container.py +++ b/src/Container/SALOME_Container.py @@ -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 #------------------------------------------------------------------------- diff --git a/src/Container/SALOME_ContainerPy.py b/src/Container/SALOME_ContainerPy.py index 41cfcaeee..f3ce5f661 100755 --- a/src/Container/SALOME_ContainerPy.py +++ b/src/Container/SALOME_ContainerPy.py @@ -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 #------------------------------------------------------------------------- -- 2.39.2