Commit 15c349ec authored by Stefan Behnel's avatar Stefan Behnel

fix ref-leak during Py2-style class instantiation

parent 5c1458d1
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment