Salome HOME
[EDF28974] : Move to python implementation of driver and integrate monitoring into...
[modules/yacs.git] / src / runtime / RuntimeSALOME.cxx
index 20d20215073b790f601a4fcf2978bbbe86cec03a..c8ea03c2877a216b2e182dd17b8ef58a16a240a9 100644 (file)
@@ -420,7 +420,7 @@ void RuntimeSALOME::init(long flags, int argc, char* argv[])
     }
 }
 
-void RuntimeSALOME::fini()
+void RuntimeSALOME::fini(bool isFinalizingPython)
 {
   if (_usePython)
     {
@@ -449,8 +449,9 @@ void RuntimeSALOME::fini()
       nodeMap.erase("PyFunction");
       nodeMap.erase("PyScript");
       nodeMap.erase("SalomePythonNode");
-
-      Py_Finalize();
+      
+      if( isFinalizingPython )
+        Py_Finalize();
 #ifdef REFCNT
       DEBTRACE("_orb refCount: " << ((omniOrbORB*)_orb.in())->pd_refCount);
 #endif