]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
_narrow cand send an exception !
authorribes <ribes>
Mon, 30 Mar 2009 13:30:46 +0000 (13:30 +0000)
committerribes <ribes>
Mon, 30 Mar 2009 13:30:46 +0000 (13:30 +0000)
src/Container/SALOME_ContainerManager.cxx

index fdf1465b16bf8c245cf5c77c01235a7466a1c736..1273018a2e03a3290452942ffe77de0334e78e3c 100644 (file)
@@ -145,32 +145,33 @@ void SALOME_ContainerManager::ShutdownContainers()
     for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){
       SCRUTE((*iter));
     }
-    for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++){
-      SCRUTE((*iter));
-      CORBA::Object_var obj=_NS->Resolve((*iter).c_str());
-      Engines::Container_var cont=Engines::Container::_narrow(obj);
-      if(!CORBA::is_nil(cont))
-        {
+    for(list<string>::iterator iter=lstCont.begin();iter!=lstCont.end();iter++)
+    {
+      try
+      {
+       SCRUTE((*iter));
+       CORBA::Object_var obj=_NS->Resolve((*iter).c_str());
+       Engines::Container_var cont=Engines::Container::_narrow(obj);
+       if(!CORBA::is_nil(cont))
+       {
          MESSAGE("ShutdownContainers: " << (*iter));
-          try
-            {
-              cont->Shutdown();
-            }
-          catch(CORBA::SystemException& e)
-            {
-              INFOS("CORBA::SystemException ignored : " << e);
-            }
-          catch(CORBA::Exception&)
-            {
-              INFOS("CORBA::Exception ignored.");
-            }
-          catch(...)
-            {
-              INFOS("Unknown exception ignored.");
-            }
-        }
-      else 
-        MESSAGE("ShutdownContainers: no container ref for " << (*iter));
+         cont->Shutdown();
+       }
+       else 
+         MESSAGE("ShutdownContainers: no container ref for " << (*iter));
+      }
+      catch(CORBA::SystemException& e)
+      {
+       INFOS("CORBA::SystemException ignored : " << e);
+      }
+      catch(CORBA::Exception&)
+      {
+       INFOS("CORBA::Exception ignored.");
+      }
+      catch(...)
+      {
+       INFOS("Unknown exception ignored.");
+      }
     }
   }
 }