Salome HOME
[EDF29150] : Fix bug at shutdown
[modules/kernel.git] / src / Container / Container_i.cxx
index 249e9847327ab51f18d9d168ab43b34fa927cda4..872e161ab7c5e9ba19a203975d59d6c4e4cf7166 100644 (file)
@@ -117,7 +117,7 @@ std::map<std::string, void *> Abstract_Engines_Container_i::_library_map;
 std::map<std::string, void *> Abstract_Engines_Container_i::_toRemove_map;
 omni_mutex Abstract_Engines_Container_i::_numInstanceMutex ;
 
-static PyObject* _pyCont;
+static PyObject *_pyCont = nullptr;
 
 int checkifexecutable(const std::string&);
 int findpathof(const std::string& path, std::string&, const std::string&);
@@ -748,6 +748,11 @@ void Abstract_Engines_Container_i::Shutdown()
   //
   this->cleanAllPyScripts();
   //
+  {
+    AutoGIL gstate;
+    AutoPyRef result = PyObject_CallMethod(_pyCont, (char*)"shutdownPy", (char*)"",nullptr);
+  }
+  //
   if(_isServantAloneInProcess)
   {
     MESSAGE("Effective Shutdown of container Begins...");