Don't free Context from python.

There might be a better way to do this, Cambo, please check.

This solves the Totblock == -1 error
This commit is contained in:
2009-11-09 23:33:56 +00:00
parent 60ea745613
commit d34261edab

View File

@@ -320,9 +320,12 @@ static void pyrna_struct_dealloc( BPy_StructRNA * self )
{ {
if (self->freeptr && self->ptr.data) { if (self->freeptr && self->ptr.data) {
IDP_FreeProperty(self->ptr.data); IDP_FreeProperty(self->ptr.data);
if (self->ptr.type != &RNA_Context)
{
MEM_freeN(self->ptr.data); MEM_freeN(self->ptr.data);
self->ptr.data= NULL; self->ptr.data= NULL;
} }
}
/* Note, for subclassed PyObjects we cant just call PyObject_DEL() directly or it will crash */ /* Note, for subclassed PyObjects we cant just call PyObject_DEL() directly or it will crash */
Py_TYPE(self)->tp_free(self); Py_TYPE(self)->tp_free(self);