Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/superv.git] / src / GraphExecutor / DataFlowExecutor_PyDynInvoke.cxx
index 85fc431b5bea453571f46a6746135542b7c1a930..68211dadd9ae588aadae2d0d05cbb5600e5e35c3 100644 (file)
@@ -392,8 +392,12 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
         ArgValue = Py_BuildValue( "O" , ResultObj ) ;
         PyTuple_SetItem( ArgsList , i , ArgValue ) ;
 #if PyDynInvokeTrace
-        cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value  (objref) ArgsList->ob_refcnt"
-               << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+       if ( ArgValue )
+         cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value  (objref) ArgsList->ob_refcnt"
+                << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+       else
+         cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value  (objref) ArgsList->ob_refcnt"
+                << ArgsList->ob_refcnt << " ArgValue is NULL" << endl ;
         cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
 #endif
         Py_DECREF( MyPyObjRefList ) ;
@@ -402,9 +406,13 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
         }
         else {
 #if PyDynInvokeTrace
-          cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+         if ( ResultObj )
+           cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+         else
+           cdebug << "ResultObj is NULL" << endl ;
 #endif
-          Py_DECREF( ResultObj ) ;
+         if ( ResultObj )
+           Py_DECREF( ResultObj ) ;
         }
         break ;
       }
@@ -573,7 +581,8 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             f = PyFloat_AsDouble( ArgValue ) ;
          }
-          data <<= f ;
+         data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+          //data <<= f ;
 #if PyDynInvokeTrace
           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)"
                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
@@ -597,7 +606,8 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod ,
           else {
             d = PyFloat_AsDouble( ArgValue ) ;
          }
-          data <<= d ;
+         data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+          //data <<= d ;
 #if PyDynInvokeTrace
           cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
                  << " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"