Part: [skip ci] fix memory leaks
+ add convenience function GeometryExtension::copyPyObject() + make sure to destroy the clone when leaving getGeometry()
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include "GeometryExtension.h"
|
||||
#include "GeometryExtensionPy.h"
|
||||
|
||||
using namespace Part;
|
||||
|
||||
@@ -37,6 +38,13 @@ GeometryExtension::GeometryExtension()
|
||||
{
|
||||
}
|
||||
|
||||
PyObject* GeometryExtension::copyPyObject() const
|
||||
{
|
||||
Py::Tuple tuple;
|
||||
Py::Object obj = Py::asObject(const_cast<GeometryExtension*>(this)->getPyObject());
|
||||
return static_cast<GeometryExtensionPy *>(obj.ptr())->copy(tuple.ptr());
|
||||
}
|
||||
|
||||
TYPESYSTEM_SOURCE_ABSTRACT(Part::GeometryPersistenceExtension,Part::GeometryExtension)
|
||||
|
||||
void GeometryPersistenceExtension::restoreNameAttribute(Base::XMLReader &reader)
|
||||
|
||||
Reference in New Issue
Block a user