From b724d59dd85b40481542bb4aa08f527ffa542b05 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 8 Jul 2008 17:13:53 +0000 Subject: Fix refleake discussed in #848. Only applied part of the patch. --- numpy/core/src/scalartypes.inc.src | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'numpy') diff --git a/numpy/core/src/scalartypes.inc.src b/numpy/core/src/scalartypes.inc.src index 3feefc070..680a5eca8 100644 --- a/numpy/core/src/scalartypes.inc.src +++ b/numpy/core/src/scalartypes.inc.src @@ -1883,10 +1883,11 @@ static PyObject * _WORK@work@ - if (!PyArg_ParseTuple(args, "|O", &obj)) return NULL; + if (!PyArg_ParseTuple(args, "|O", &obj)) return NULL; typecode = PyArray_DescrFromType(PyArray_@TYPE@); - Py_INCREF(typecode); + /* typecode is new reference and stolen by + PyArray_Scalar and others */ if (obj == NULL) { #if @default@ == 0 char *mem; -- cgit v1.2.1