From 4d3030b36c61f2be009916281c32d2868e9d61e5 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 3 Nov 2010 21:44:55 +0100 Subject: [PATCH] fix ref-leak in Py2 metaclass support --- Cython/Compiler/ExprNodes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index af17c28f..0bb334de 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -7187,6 +7187,7 @@ static PyObject *__Pyx_CreateClass( } result = PyObject_CallFunctionObjArgs(metaclass, name, bases, methods, NULL); + Py_DECREF(metaclass); #else /* it seems that python3+ handle __metaclass__ itself */ result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, methods, NULL); -- 2.26.2