From 51537af05ab9c2075040ec81a2f57d079e52ca32 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 22 Feb 2006 06:27:47 +0000 Subject: [PATCH] fix bug #1094964 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8860 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Doc/Manual/Python.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html index c15a19dac..9925eca15 100644 --- a/Doc/Manual/Python.html +++ b/Doc/Manual/Python.html @@ -4416,10 +4416,12 @@ arrays of different sizes. To do this, you might write a typemap as follows: for (i =0; i < $1_dim0; i++) { PyObject *o = PySequence_GetItem($input,i); if (!PyFloat_Check(o)) { + Py_XDECREF(o); PyErr_SetString(PyExc_ValueError,"Expecting a sequence of floats"); return NULL; } temp[i] = PyFloat_AsDouble(o); + Py_DECREF(o); } $1 = &temp[0]; } @@ -4460,10 +4462,12 @@ static int convert_darray(PyObject *input, double *ptr, int size) { for (i =0; i < size; i++) { PyObject *o = PySequence_GetItem(input,i); if (!PyFloat_Check(o)) { + Py_XDECREF(o); PyErr_SetString(PyExc_ValueError,"Expecting a sequence of floats"); return 0; } ptr[i] = PyFloat_AsDouble(o); + Py_DECREF(o); } return 1; }