Base: [skip ci] allow to replace twin object of PyObjectBase

This commit is contained in:
wmayer
2020-09-28 11:21:20 +02:00
parent 0fd7f05a5f
commit 27b9192539
2 changed files with 13 additions and 0 deletions

View File

@@ -62,6 +62,16 @@ PyObjectBase::~PyObjectBase()
Py_XDECREF(attrDict);
}
void PyObjectBase::setPointer(void* ptr, bool del)
{
if (_pcTwinPointer == ptr)
return;
if (del)
delete _pcTwinPointer;
_pcTwinPointer = ptr;
}
/*------------------------------
* PyObjectBase Type -- Every class, even the abstract one should have a Type
------------------------------*/