Commit 32661979 authored by Kevin Modzelewski's avatar Kevin Modzelewski

gets through weakref with zero leaks

parent 28f29554
......@@ -41,7 +41,7 @@ PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *,
const char *, char **, va_list) PYSTON_NOEXCEPT;
PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list) PYSTON_NOEXCEPT;
PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *) PYSTON_NOEXCEPT;
PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, STOLEN(PyObject *)) PYSTON_NOEXCEPT;
PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long) PYSTON_NOEXCEPT;
PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *) PYSTON_NOEXCEPT;
#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
......
......@@ -442,7 +442,8 @@ extern "C" int PyModule_AddObject(PyObject* _m, const char* name, PyObject* valu
BoxedModule* m = static_cast<BoxedModule*>(_m);
assert(m->cls == module_cls);
m->setattr(internStringMortal(name), value, NULL);
m->setattr(autoDecref(internStringMortal(name)), value, NULL);
Py_DECREF(value);
return 0;
}
......
......@@ -2638,6 +2638,7 @@ static int add_methods(PyTypeObject* type, PyMethodDef* meth) noexcept {
return -1;
type->setattr(name, descr, NULL);
Py_DECREF(descr);
Py_DECREF(name);
}
return 0;
}
......@@ -3380,6 +3381,7 @@ extern "C" void PyType_GiveHcAttrsDictDescr(PyTypeObject* cls) noexcept {
extern "C" int PyType_Ready(PyTypeObject* cls) noexcept {
ASSERT(!cls->is_pyston_class, "should not call this on Pyston classes");
_Py_INC_REFTOTAL;
classes.push_back(cls);
// unhandled fields:
......
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