RNA: Fully clear data in RNA_POINTER_INVALIDATE.
Not really sure why only type and owner_id were cleared here? Especially when code like `pyrna_struct_CreatePyObject` would check for both `data` and `type` to be null to consider the pointer as None... Happens to 'fix' #134311, since now cleared PointerRNA are 'just' reset to `PointerRNA_NULL`. Would not work if the data was not an ID PointerRNA though... NOTE: In general, what is considered an invalid PointerRNA is still very loosely designed in our code-base, we'll have to address this. Pull Request: https://projects.blender.org/blender/blender/pulls/134393
This commit is contained in:
committed by
Bastien Montagne
parent
51789af3cb
commit
e55d478c64
@@ -813,9 +813,7 @@ StructRNA *ID_code_to_RNA_type(short idcode);
|
||||
|
||||
#define RNA_POINTER_INVALIDATE(ptr) \
|
||||
{ \
|
||||
/* this is checked for validity */ \
|
||||
(ptr)->type = NULL; /* should not be needed but prevent bad pointer access, just in case */ \
|
||||
(ptr)->owner_id = NULL; \
|
||||
*(ptr) = PointerRNA_NULL; \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user