Spreadsheet: in ViewProviderSheet do not add a second member to store the Python wrapper because the base class already has it
and it invalidates the wrapper in case the it is destroyed
This commit is contained in:
@@ -185,11 +185,10 @@ void ViewProviderSheet::updateData(const App::Property* prop)
|
||||
|
||||
PyObject *ViewProviderSheet::getPyObject()
|
||||
{
|
||||
if (PythonObject.is(Py::_None())){
|
||||
// ref counter is set to 1
|
||||
PythonObject = Py::Object(new ViewProviderSpreadsheetPy(this), true);
|
||||
}
|
||||
return Py::new_reference_to(PythonObject);
|
||||
if (!pyViewObject)
|
||||
pyViewObject = new ViewProviderSpreadsheetPy(this);
|
||||
pyViewObject->IncRef();
|
||||
return pyViewObject;
|
||||
}
|
||||
|
||||
// Python feature -----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user