diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-06-05 16:16:31 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-06-05 16:16:31 +0200 |
| commit | f4fc81750d2dd7df9eda9599d2841ea70ff610ad (patch) | |
| tree | 4ccebbca30a813d374c89f1a5c92fc327ae2229a /python/apt_pkgmodule.cc | |
| parent | 5160ad8b3f71cb256e62bab5fc532d3d73b2f7b4 (diff) | |
| download | python-apt-f4fc81750d2dd7df9eda9599d2841ea70ff610ad.tar.gz | |
python/apt_pkgmodule.cc: Fix refcount problem.
Diffstat (limited to 'python/apt_pkgmodule.cc')
| -rw-r--r-- | python/apt_pkgmodule.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 403e0ebf..a34d4720 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -500,8 +500,9 @@ static PyMethodDef methods[] = }; -#define ADDTYPE(mod,name,type) { Py_INCREF(type); \ +#define ADDTYPE(mod,name,type) { \ if (PyType_Ready(type) == -1) INIT_ERROR; \ + Py_INCREF(type); \ PyModule_AddObject(mod,name,(PyObject *)type); } @@ -557,6 +558,7 @@ extern "C" void initapt_pkg() Config->Object = _config; PyModule_AddObject(Module,"config",Config); #ifdef COMPAT_0_7 + Py_INCREF(Config); PyModule_AddObject(Module,"Config",Config); #endif |
