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>2009-08-14 16:29:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-14 16:29:55 +0400
commit08f0938434598b23d0dd1879f598e342a194cb63 (patch)
tree24534061675641b9efab5e69508ac9bde30b5efa /source/blender/makesrna/intern/rna_ui.c
parent4bbccd39bc827e5d794bdbe987b4d48164e8d950 (diff)
- registering new python classes runs the free functions on existing classes.
- print an error if RNA Structs are freed with a python pointer set to help with debugging leaks. - fix for unlikely eternal loop in unit conversion.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 590f85fedd7..5a33bcd6374 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -138,6 +138,9 @@ 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 */
+
BLI_freelinkN(&art->paneltypes, pt);
RNA_struct_free(&BLENDER_RNA, type);
@@ -233,6 +236,9 @@ 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 */
+
BLI_freelinkN(&art->headertypes, ht);
RNA_struct_free(&BLENDER_RNA, type);
@@ -347,6 +353,9 @@ 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 */
+
BLI_freelinkN(&art->menutypes, mt);
RNA_struct_free(&BLENDER_RNA, type);