diff options
| author | Simon McVittie <smcv@debian.org> | 2010-12-02 17:27:34 +0000 |
|---|---|---|
| committer | Simon McVittie <smcv@debian.org> | 2010-12-02 17:27:34 +0000 |
| commit | d3f57baf2a9e5e26e2365313abd2890239b6572a (patch) | |
| tree | af069da129d5b0d17f9dcb294cedc8bd1a607002 /_dbus_bindings/float.c | |
| parent | 56ad64cd14e52b479489549f76343f19e3842139 (diff) | |
| download | dbus-python-d3f57baf2a9e5e26e2365313abd2890239b6572a.tar.gz | |
fd.o #23831: make sure to ref types passed to PyModule_AddObject
This avoids these static types wrongly being deallocated. Python
implements static types as having one initial reference, which is never
meant to be released, but if you get your refcounting wrong they'll be
"deallocated" (causing a crash) during Py_Finalize.
Diffstat (limited to '_dbus_bindings/float.c')
| -rw-r--r-- | _dbus_bindings/float.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/_dbus_bindings/float.c b/_dbus_bindings/float.c index 5826ec3..734c4ab 100644 --- a/_dbus_bindings/float.c +++ b/_dbus_bindings/float.c @@ -145,6 +145,7 @@ dbus_py_init_float_types(void) dbus_bool_t dbus_py_insert_float_types(PyObject *this_module) { + /* PyModule_AddObject steals a ref */ Py_INCREF(&DBusPyDouble_Type); if (PyModule_AddObject(this_module, "Double", (PyObject *)&DBusPyDouble_Type) < 0) return 0; |
