Salome HOME
Fix bug causing Python to deallocate None
authorRenaud Barate <renaud.barate@edf.fr>
Tue, 7 Apr 2015 14:31:02 +0000 (16:31 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Tue, 7 Apr 2015 14:31:02 +0000 (16:31 +0200)
This bug could happen on schemas with very large numbers of Python nodes

src/runtime/PythonPorts.cxx

index 9e7f817e791913be91526b3dfb747f2df0c373bc..4d25d1f09b534c27e40c2f8fe1ca664ef024024c 100644 (file)
@@ -283,6 +283,7 @@ OutputPyPort::~OutputPyPort()
 OutputPyPort::OutputPyPort(const OutputPyPort& other, Node *newHelder):OutputPort(other,newHelder),DataPort(other,newHelder),Port(other,newHelder),
                                                                        _data(Py_None)
 {
+  Py_INCREF(_data);
 }
 
 void OutputPyPort::put(const void *data) throw(ConversionException)