summaryrefslogtreecommitdiff
path: root/python/apt_pkgmodule.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-31 14:55:02 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-31 14:55:02 +0200
commitc41f809bef5b591d36d6bbb663841a9434eb77fb (patch)
treeee44a80c5bfcc8be0c2872b4093d62c83b84cc30 /python/apt_pkgmodule.cc
parentebe1f37a65cae8303bf86da13f3f2107cd73d1fe (diff)
downloadpython-apt-c41f809bef5b591d36d6bbb663841a9434eb77fb.tar.gz
python/configuration.cc, apt_pkgmodule.cc: Fix Configuration segfaults.
In apt_pkgmodule, change the type to Configuration*. In configuration.cc, check that GetSelf(Self).Tree(0) != 0 before doing GetSelf(Self).Tree(0)->Parent.
Diffstat (limited to 'python/apt_pkgmodule.cc')
-rw-r--r--python/apt_pkgmodule.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index 9e486a91..d53f64a6 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -56,7 +56,7 @@ static PyObject *newConfiguration(PyObject *self,PyObject *args)
{
PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.newConfiguration() is "
"deprecated. Use apt_pkg.Configuration() instead.", 1);
- return CppPyObject_NEW<Configuration>(&PyConfiguration_Type);
+ return CppOwnedPyObject_NEW<Configuration*>(NULL, &PyConfiguration_Type, new Configuration());
}
#endif
/*}}}*/