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:
authorCampbell Barton <ideasman42@gmail.com>2011-01-25 10:31:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-25 10:31:11 +0300
commit57289044ca68859eaf5981db9d72ed438555fd37 (patch)
tree0617e552c5a900eea48cca7e7dd73c46df46fd5f /source/blender/python
parentc0e74f9dce632795ed6e083436353b4df4d7e62c (diff)
improve unregister error check not to loop over parent classes properties (would check the same property multiple times)
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_rna.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index b57683742fc..217d0c9e1bf 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -5166,7 +5166,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun
}
/* verify callback functions */
- lb= RNA_struct_defined_functions(srna);
+ lb= RNA_struct_type_functions(srna);
i= 0;
for(link=lb->first; link; link=link->next) {
func= (FunctionRNA*)link;
@@ -5668,26 +5668,25 @@ static PyObject *pyrna_basetype_register(PyObject *UNUSED(self), PyObject *py_cl
static int pyrna_srna_contains_pointer_prop_srna(StructRNA *srna_props, StructRNA *srna, const char **prop_identifier)
{
- PointerRNA tptr;
- PropertyRNA *iterprop;
- RNA_pointer_create(NULL, &RNA_Struct, srna_props, &tptr);
-
- iterprop= RNA_struct_find_property(&tptr, "properties");
+ PropertyRNA *prop;
+ LinkData *link;
- RNA_PROP_BEGIN(&tptr, itemptr, iterprop) {
- PropertyRNA *prop= itemptr.data;
- if(RNA_property_type(prop) == PROP_POINTER) {
- if (strcmp(RNA_property_identifier(prop), "rna_type") == 0) {
- /* pass */
- }
- else if(RNA_property_pointer_type(&tptr, prop) == srna) {
+ /* verify properties */
+ const ListBase *lb= RNA_struct_type_properties(srna);
+
+ for(link=lb->first; link; link=link->next) {
+ prop= (PropertyRNA*)link;
+ if(RNA_property_type(prop) == PROP_POINTER && !(RNA_property_flag(prop) & PROP_BUILTIN)) {
+ PointerRNA tptr;
+ RNA_pointer_create(NULL, &RNA_Struct, srna_props, &tptr);
+
+ if(RNA_property_pointer_type(&tptr, prop) == srna) {
*prop_identifier= RNA_property_identifier(prop);
return 1;
}
}
}
- RNA_PROP_END;
-
+
return 0;
}