From: <md...@us...> - 2008-05-02 17:00:22
|
Revision: 5106 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5106&view=rev Author: mdboom Date: 2008-05-02 10:00:01 -0700 (Fri, 02 May 2008) Log Message: ----------- Merged revisions 5102-5105 via svnmerge from https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint ........ r5104 | mdboom | 2008-05-02 12:55:59 -0400 (Fri, 02 May 2008) | 3 lines Update _subprocess.c from upstream Python 2.5.2 to get a few memory and reference-counting-related bugfixes. See bug 1949978. - MGD ........ Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/src/_subprocess.c Property Changed: ---------------- trunk/matplotlib/ Property changes on: trunk/matplotlib ___________________________________________________________________ Name: svnmerge-integrated - /branches/v0_91_maint:1-5101 + /branches/v0_91_maint:1-5105 Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-05-02 16:57:45 UTC (rev 5105) +++ trunk/matplotlib/CHANGELOG 2008-05-02 17:00:01 UTC (rev 5106) @@ -1,3 +1,7 @@ +2008-05-02 Update _subprocess.c from upstream Python 2.5.2 to get a + few memory and reference-counting-related bugfixes. See + bug 1949978. - MGD + 2008-04-30 Added some record array editing widgets for gtk -- see examples/rec_edit*.py - JDH Modified: trunk/matplotlib/src/_subprocess.c =================================================================== --- trunk/matplotlib/src/_subprocess.c 2008-05-02 16:57:45 UTC (rev 5105) +++ trunk/matplotlib/src/_subprocess.c 2008-05-02 17:00:01 UTC (rev 5106) @@ -104,12 +104,12 @@ { if (self->handle != INVALID_HANDLE_VALUE) CloseHandle(self->handle); - PyMem_DEL(self); + PyObject_FREE(self); } static PyMethodDef sp_handle_methods[] = { - {"Detach", (PyCFunction) sp_handle_detach, 1}, - {"Close", (PyCFunction) sp_handle_close, 1}, + {"Detach", (PyCFunction) sp_handle_detach, METH_VARARGS}, + {"Close", (PyCFunction) sp_handle_close, METH_VARARGS}, {NULL, NULL} }; @@ -250,19 +250,23 @@ getint(PyObject* obj, char* name) { PyObject* value; + int ret; value = PyObject_GetAttrString(obj, name); if (! value) { PyErr_Clear(); /* FIXME: propagate error? */ return 0; } - return (int) PyInt_AsLong(value); + ret = (int) PyInt_AsLong(value); + Py_DECREF(value); + return ret; } static HANDLE gethandle(PyObject* obj, char* name) { sp_handle_object* value; + HANDLE ret; value = (sp_handle_object*) PyObject_GetAttrString(obj, name); if (! value) { @@ -270,8 +274,11 @@ return NULL; } if (value->ob_type != &sp_handle_type) - return NULL; - return value->handle; + ret = NULL; + else + ret = value->handle; + Py_DECREF(value); + return ret; } static PyObject* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |