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:
Bastien Montagne
2025-02-18 12:31:20 +01:00
parent 94285011b0
commit 6b0ad2e16b
36 changed files with 100 additions and 89 deletions

View File

@@ -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

View File

@@ -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;
}