[Python-checkins] python/nondist/sandbox/datetime obj_timetz.c,1.7,1.8

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2002年12月11日 14:17:01 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv20541
Modified Files:
	obj_timetz.c 
Log Message:
Gave timetz a proper tp_dealloc function. test_both no longer leaks.
Index: obj_timetz.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_timetz.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** obj_timetz.c	11 Dec 2002 21:34:48 -0000	1.7
--- obj_timetz.c	11 Dec 2002 22:16:59 -0000	1.8
***************
*** 52,55 ****
--- 52,64 ----
 }
 
+ /* Destructor. */
+ 
+ static void
+ timetz_dealloc(PyDateTime_TimeTZ *self)
+ {
+ 	Py_XDECREF(self->tzinfo);
+ 	self->ob_type->tp_free((PyObject *)self);
+ }
+ 
 /* Various ways to turn a time into a string. */
 
***************
*** 281,285 ****
 	sizeof(PyDateTime_TimeTZ),		/* tp_basicsize */
 	0,					/* tp_itemsize */
! 	(destructor)PyObject_Del,		/* tp_dealloc */
 	0,					/* tp_print */
 	0,					/* tp_getattr */
--- 290,294 ----
 	sizeof(PyDateTime_TimeTZ),		/* tp_basicsize */
 	0,					/* tp_itemsize */
! 	(destructor)timetz_dealloc,		/* tp_dealloc */
 	0,					/* tp_print */
 	0,					/* tp_getattr */

AltStyle によって変換されたページ (->オリジナル) /