Hi Martin, Barry,

for a little extra correctness, I would propose to amend Barry's patch (which fixes the problem at hand perfectly, mind you) as attached. The additional substitution of PyObject_New for PyObject_NEW is what the Python API docs recommend[1]. They seem to do the same for know, but only using the the "properly" capitalized New/Del functions might save us revisiting that file this next time around.

Kind regards

T.

1. By not even mentioning the old macros
 http://docs.python.org/api/allocating-objects.html#l2h-956
but it seems similar in spirit to PyMem_NEW/DEL vs. New/Del
 http://docs.python.org/api/memoryInterface.html
fun, isn't it?
--
Thomas Viehmann, http://thomas.viehmann.net
--- jack-3.1.1+cvs20050801~/debian/patches/100_pymem_del.patch
+++ jack-3.1.1+cvs20050801/debian/patches/100_pymem_del.patch
@@ -0,0 +1,21 @@
+diff -Nur jack-3.1.1+cvs20050801/cursesmodule/jack_cursesmodule.c jack-3.1.1+cvs20050801.new/cursesmodule/jack_cursesmodule.c
+--- jack-3.1.1+cvs20050801/cursesmodule/jack_cursesmodule.c	2006-02-05 09:09:07.000000000 -0500
++++ jack-3.1.1+cvs20050801.new/cursesmodule/jack_cursesmodule.c	2008-03-05 22:46:41.000000000 -0500
+@@ -259,7 +259,7 @@
+ {
+ 	PyCursesWindowObject *wo;
+ 
+-	wo = PyObject_NEW(PyCursesWindowObject, &PyCursesWindow_Type);
++	wo = PyObject_New(PyCursesWindowObject, &PyCursesWindow_Type);
+ 	if (wo == NULL) return NULL;
+ 	wo->win = win;
+ 	return (PyObject *)wo;
+@@ -270,7 +270,7 @@
+ 	PyCursesWindowObject *wo;
+ {
+   if (wo->win != stdscr) delwin(wo->win);
+-  PyMem_DEL(wo);
++  PyObject_Del(wo);
+ }
+ 
+ /* Addch, Addstr, Addnstr */

Reply via email to