Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-11-02 19:00:55 +0300
committerBastien Montagne <bastien@blender.org>2020-11-02 19:08:10 +0300
commitdb18ba07b502fd64955626241a6a40333cdc63bd (patch)
tree5275413cdabe64415464e7d71baa7b467c40ba6e /source
parent4c460a2dbd0eed9950737690ce691092fb107d1e (diff)
Fix py-defined pointer properties wrong tag re ID ownership.
This fixes critical bug with liboverride when soe add-ons add some RNA ID Pointer properties. ID pointers should **never** have ownership of their ID when defined from python. (As a reminder, RNA properties owning their ID pointers are extremely rare even from C code, only embedded IDs (root node trees, master collections) and the shape keys snowflakes are concerned.)
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_define.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 8eb964b8c17..c31d170113d 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -1843,6 +1843,10 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
DefRNA.error = true;
break;
}
+
+ if ((type->flag & STRUCT_ID) != 0) {
+ prop->flag |= PROP_PTR_NO_OWNERSHIP;
+ }
}
void RNA_def_property_enum_native_type(PropertyRNA *prop, const char *native_enum_type)