projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c1458d
)
fix ref-leak during Py2-style class instantiation
author
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 1 Nov 2013 10:30:45 +0000
(11:30 +0100)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Fri, 1 Nov 2013 10:30:45 +0000
(11:30 +0100)
Cython/Utility/ObjectHandling.c
patch
|
blob
|
history
diff --git
a/Cython/Utility/ObjectHandling.c
b/Cython/Utility/ObjectHandling.c
index
c9c7638
..
3bceca2
100644
(file)
--- a/
Cython/Utility/ObjectHandling.c
+++ b/
Cython/Utility/ObjectHandling.c
@@
-668,9
+668,11
@@
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
if (!metaclass) {
PyErr_Clear();
metaclass = (PyObject*) Py_TYPE(base);
+ Py_INCREF(metaclass);
}
} else {
metaclass = (PyObject *) &PyClass_Type;
+ Py_INCREF(metaclass);
}
#else
if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
@@
-679,8
+681,8
@@
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
} else {
metaclass = (PyObject *) &PyType_Type;
}
-#endif
Py_INCREF(metaclass);
+#endif
return metaclass;
}