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>2012-01-13 15:36:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-13 15:36:32 +0400
commit0f34ce27cf9c44cb5f10d4033be407c00fee2a09 (patch)
tree5aec8ab8c56afd193a1a4550f753dcff5d891138
parente06d82227c2d6fc58f3e3d28852f251c1de68997 (diff)
fix for error comparing py-struct members
if 2 pyrna structs used the same pointer they could incorrectly compare as true, this caused an error in theme saving because an item could match its parent and stop writing (to prevent recursive writing of same data). eg: context.user_preferences.themes[0].user_interface.wcol_regular == context.user_preferences.themes[0].user_interface
-rw-r--r--source/blender/python/intern/bpy_rna.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 588f08224c8..eaa8b82e4d7 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -745,7 +745,7 @@ int pyrna_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int
static int pyrna_struct_compare(BPy_StructRNA *a, BPy_StructRNA *b)
{
- return (a->ptr.data == b->ptr.data) ? 0 : -1;
+ return (a->ptr.data == b->ptr.data && a->ptr.type == b->ptr.type) ? 0 : -1;
}
static int pyrna_prop_compare(BPy_PropertyRNA *a, BPy_PropertyRNA *b)