Salome HOME
[bos #37406][CEA] Fixed segfault in YACS_YacsRuntimeTest on UB22,FD36 and FD37 by...
[modules/yacs.git] / src / runtime / Test / runtimeTest.cxx
index 01fa8b123adee0652878efcea7b9e43c93ff691d..f48e044186249c9edd66c871ecb7f9a4db0e4a37 100644 (file)
@@ -1400,8 +1400,12 @@ void RuntimeTest::convertPorts()
               cAny <<= (CORBA::Double) d0;
               break;
             case 2:
+            {
+              PyGILState_STATE gstate = PyGILState_Ensure();
               v = pAny = PyFloat_FromDouble(d0);
+              PyGILState_Release(gstate);
               break;
+            }
             case 3:
               { 
                 ostringstream os;
@@ -1484,8 +1488,12 @@ void RuntimeTest::convertPorts()
                 vAny->decrRef();
                 break;
               case 2:
-                Py_DECREF(pAny);
+              {
+                PyGILState_STATE gstate = PyGILState_Ensure();
+                Py_XDECREF(pAny);
+                PyGILState_Release(gstate);
                 break;
+              }
               default:
                 break;
               }