fix for referencing freed memory when freeing an rna property.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 13 Aug 2010 21:49:31 +0000 (21:49 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 13 Aug 2010 21:49:31 +0000 (21:49 +0000)
source/blender/makesrna/intern/rna_define.c

index d89d0ad..6080d02 100644 (file)
@@ -2728,14 +2728,16 @@ 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_def_property_free_pointers(prop);
                rna_freelinkN(&cont->properties, prop);
        }
+       else {
+               RNA_def_property_free_pointers(prop);
+       }
 }
 
 /* note: only intended for removing dynamic props */