added debugging messages to deallocation

develop
doomchild 2010-04-12 14:47:11 -05:00
parent c296080cac
commit 2eb66640bf
2 changed files with 20 additions and 0 deletions

@ -166,17 +166,27 @@ static int DF_Material_init(DF_Material* self, PyObject* args, PyObject* kwds)
static void DF_Material_dealloc(DF_Material* self) static void DF_Material_dealloc(DF_Material* self)
{ {
PySys_WriteStdout("material dealloc\n");
if(self != NULL) if(self != NULL)
{ {
PySys_WriteStdout("material not NULL\n");
if(self->mat_Ptr != NULL) if(self->mat_Ptr != NULL)
{ {
PySys_WriteStdout("mat_Ptr = %i\n", (int)self->mat_Ptr);
delete self->mat_Ptr; delete self->mat_Ptr;
PySys_WriteStdout("mat_Ptr deleted\n");
self->mat_Ptr = NULL; self->mat_Ptr = NULL;
} }
self->ob_type->tp_free((PyObject*)self); self->ob_type->tp_free((PyObject*)self);
} }
PySys_WriteStdout("material dealloc done\n");
} }
// Type methods // Type methods

@ -63,17 +63,27 @@ static int DF_MemInfo_init(DF_MemInfo* self, PyObject* args, PyObject* kwds)
static void DF_MemInfo_dealloc(DF_MemInfo* self) static void DF_MemInfo_dealloc(DF_MemInfo* self)
{ {
PySys_WriteStdout("mem_info dealloc\n");
if(self != NULL) if(self != NULL)
{ {
PySys_WriteStdout("mem_info not NULL\n");
if(self->mem_Ptr != NULL) if(self->mem_Ptr != NULL)
{ {
PySys_WriteStdout("mem_Ptr = %i\n", (int)self->mem_Ptr);
delete self->mem_Ptr; delete self->mem_Ptr;
PySys_WriteStdout("mem_Ptr deleted\n");
self->mem_Ptr = NULL; self->mem_Ptr = NULL;
} }
self->ob_type->tp_free((PyObject*)self); self->ob_type->tp_free((PyObject*)self);
} }
PySys_WriteStdout("mem_info dealloc done\n");
} }
// Setters/Getters // Setters/Getters