Skip to content
Snippets Groups Projects
Commit 0f34ce27 authored by Campbell Barton's avatar Campbell Barton
Browse files

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
parent e06d8222
Branches
Tags
No related merge requests found
...@@ -745,7 +745,7 @@ int pyrna_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int ...@@ -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) 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) static int pyrna_prop_compare(BPy_PropertyRNA *a, BPy_PropertyRNA *b)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment