Salome HOME
Merge branch 'Dev_1.1.1' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_PyInterp.cpp
index 4afbfaa2a93f75a404e12d1f7cd57c2dd6bb12ee..53659f23fdbd89ab61bc1438f5a380aa2575e536 100644 (file)
@@ -136,7 +136,14 @@ bool ParametersPlugin_PyInterp::initContext()
   }
   _global_context = PyModule_GetDict(m);          // get interpreter global variable context
   Py_INCREF(_global_context);
-  _local_context = _global_context;
+  _local_context = PyDict_New();
+  Py_INCREF(_local_context);
 
   return PyRun_SimpleString("from math import *") == 0;
 }
+
+void ParametersPlugin_PyInterp::closeContext()
+{
+  Py_XDECREF(_local_context);
+  PyInterp_Interp::closeContext();
+}