diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-16 11:26:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-16 11:26:29 +0400 |
commit | d776dcf795c838996af16fca27922cec61d84b28 (patch) | |
tree | 09d3c99d48353a6ba53858505d1d4259f8d905c7 /source/blender/makesrna/intern/rna_ui.c | |
parent | d86663ee1a4e845afd15752bac6dfb05dd675f69 (diff) |
- added RNA_struct_free_extension rather then having the funcs in each unregister func.
- use RNA_struct_blender_type_set to set the type to NULL before its freed
There is a memory error here when reloading scripts - ui_handler_panel_region, need to look into theis further.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 5a33bcd6374..660dbb49027 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -138,8 +138,7 @@ static void rna_Panel_unregister(const bContext *C, StructRNA *type) if(!(art=region_type_find(NULL, pt->space_type, pt->region_type))) return; - pt->ext.free(pt->ext.data); /* decref's the PyObject that the srna owns */ - RNA_struct_py_type_set(type, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + RNA_struct_free_extension(type, &pt->ext); BLI_freelinkN(&art->paneltypes, pt); RNA_struct_free(&BLENDER_RNA, type); @@ -236,8 +235,7 @@ static void rna_Header_unregister(const bContext *C, StructRNA *type) if(!(art=region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER))) return; - ht->ext.free(ht->ext.data); /* decref's the PyObject that the srna owns */ - RNA_struct_py_type_set(type, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + RNA_struct_free_extension(type, &ht->ext); BLI_freelinkN(&art->headertypes, ht); RNA_struct_free(&BLENDER_RNA, type); @@ -353,8 +351,7 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type) if(!(art=region_type_find(NULL, mt->space_type, RGN_TYPE_HEADER))) return; - mt->ext.free(mt->ext.data); /* decref's the PyObject that the srna owns */ - RNA_struct_py_type_set(type, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + RNA_struct_free_extension(type, &mt->ext); BLI_freelinkN(&art->menutypes, mt); RNA_struct_free(&BLENDER_RNA, type); |