Salome HOME
CCAR: delete the notification supplier CORBA object with deactivate_object and _remov...
[modules/kernel.git] / src / Container / SALOME_Container.cxx
index 07024cd13e697a9ced9594a74583f79a6ac131ec..c4a1e0dba4079d9f644a07dd36b20736668644d1 100644 (file)
 //  Module : SALOME
 //  $Header$
 //
-#ifdef HAVE_MPI2
+#ifdef _MPI_SEQ_CONTAINER_
+  #ifdef HAVE_MPI2
 #include <mpi.h>
+  #endif
 #endif
 
 #include <iostream>
-#include <strstream>
+#include <sstream>
 #include <string>
 #include <stdio.h>
 #include <time.h>
@@ -118,9 +120,11 @@ void unexpectedHandler(void)
 
 int main(int argc, char* argv[])
 {
-#ifdef HAVE_MPI2
+#ifdef _MPI_SEQ_CONTAINER_
+  #ifdef HAVE_MPI2
   MPI_Init(&argc,&argv);
-#endif
+  #endif
+#endif  
 
 #ifndef WIN32
   if(getenv ("DEBUGGER"))
@@ -196,7 +200,10 @@ int main(int argc, char* argv[])
       if (!isSupervContainer)
       {
         PyGILState_Ensure();
-        //Delete python container that destroy orb from python (pyCont._orb.destroy())
+        //Destroy orb from python (for chasing memory leaks)
+        //PyRun_SimpleString("from omniORB import CORBA");
+        //PyRun_SimpleString("orb=CORBA.ORB_init([''], CORBA.ORB_ID)");
+        //PyRun_SimpleString("orb.destroy()");
         Py_Finalize();
       }
       else
@@ -225,13 +232,12 @@ int main(int argc, char* argv[])
       INFOS("Caught unknown exception.");
     }
 
-#ifdef HAVE_MPI2
+#ifdef _MPI_SEQ_CONTAINER_
+  #ifdef HAVE_MPI2
   MPI_Finalize();
-#endif
+  #endif
+#endif  
 
-  //END_OF(argv[0]);
-  //LocalTraceBufferPool* bp1 = LocalTraceBufferPool::instance();
-  //bp1->deleteInstance(bp1);
   return 0 ;
 }