Refactor: Replace RNA_POINTER_INVALIDATE RNA/BPY macro usages.
Add `PointerRNA::reset()` and `PointerRNA::invalidate()` utils functions
(both simply reset the PointerRNA data to empty state).
Replace `RNA_POINTER_INVALIDATE` macro by `PointerRNA::invalidate()`.
Follow-up to !134393 and e55d478c64.
This commit is contained in:
@@ -176,7 +176,7 @@ int pyrna_prop_validity_check(const BPy_PropertyRNA *self)
|
||||
|
||||
void pyrna_invalidate(BPy_DummyPointerRNA *self)
|
||||
{
|
||||
RNA_POINTER_INVALIDATE(&self->ptr.value());
|
||||
self->ptr->invalidate();
|
||||
}
|
||||
|
||||
#ifdef USE_PYRNA_INVALIDATE_GC
|
||||
|
||||
@@ -182,7 +182,7 @@ static PyObject *bpy_rna_data_context_enter(BPy_DataContext *self)
|
||||
static PyObject *bpy_rna_data_context_exit(BPy_DataContext *self, PyObject * /*args*/)
|
||||
{
|
||||
BKE_main_free(static_cast<Main *>(self->data_rna->ptr->data));
|
||||
RNA_POINTER_INVALIDATE(&self->data_rna->ptr.value());
|
||||
self->data_rna->ptr->invalidate();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user