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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index d0a8763baa7..fbcc3109af4 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -2722,5 +2722,39 @@ void RNA_def_property_free_pointers(PropertyRNA *prop)
}
}
}
+
+void RNA_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop)
+{
+ ContainerRNA *cont= cont_;
+
+ RNA_def_property_free_pointers(prop);
+
+ if(prop->flag & PROP_RUNTIME) {
+ if(cont->prophash)
+ BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL);
+
+ rna_freelinkN(&cont->properties, prop);
+ }
+}
+
+/* note: only intended for removing dynamic props */
+int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *identifier)
+{
+ ContainerRNA *cont= cont_;
+ PropertyRNA *prop;
+
+ for(prop= cont->properties.first; prop; prop= prop->next) {
+ if(strcmp(prop->identifier, identifier)==0) {
+ if(prop->flag & PROP_RUNTIME) {
+ RNA_def_property_free(cont_, prop);
+ return 1;
+ }
+ else {
+ return -1;
+ }
+ }
+ }
+ return 0;
+}
#endif