Base: [skip ci] allow to replace twin object of PyObjectBase
This commit is contained in:
@@ -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
|
||||
------------------------------*/
|
||||
|
||||
@@ -294,6 +294,9 @@ public:
|
||||
_pcTwinPointer = 0;
|
||||
}
|
||||
|
||||
/// Overrides the pointer to the twin object
|
||||
void setPointer(void* ptr, bool del=false);
|
||||
|
||||
bool isValid() {
|
||||
return StatusBits.test(Valid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user