summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-12 13:57:23 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-12 13:57:23 +0200
commitcd4dd0427591d6357d875f881573b0b57bc0ae31 (patch)
tree242b31ea1e77290d5bfdc32f96cfda1e65b6b0f6
parentc45715cf0269bcef053025f01a1956b75bf3c859 (diff)
downloadpython-apt-cd4dd0427591d6357d875f881573b0b57bc0ae31.tar.gz
python/sourcelist.cc: Do not delete the pkgIndexFile*, it is managed elsewhere.
-rw-r--r--python/sourcelist.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/sourcelist.cc b/python/sourcelist.cc
index aceb19ad..beb249dc 100644
--- a/python/sourcelist.cc
+++ b/python/sourcelist.cc
@@ -26,7 +26,7 @@ static PyObject *PkgSourceListFindIndex(PyObject *Self,PyObject *Args)
{
pkgSourceList *list = GetCpp<pkgSourceList*>(Self);
PyObject *pyPkgFileIter;
- PyObject *pyPkgIndexFile;
+ CppOwnedPyObject<pkgIndexFile*> *pyPkgIndexFile;
if (PyArg_ParseTuple(Args, "O!", &PackageFileType,&pyPkgFileIter) == 0)
return 0;
@@ -36,6 +36,8 @@ static PyObject *PkgSourceListFindIndex(PyObject *Self,PyObject *Args)
if(list->FindIndex(i, index))
{
pyPkgIndexFile = CppOwnedPyObject_NEW<pkgIndexFile*>(pyPkgFileIter,&PackageIndexFileType,index);
+ // Do not delete the pkgIndexFile*, it is managed by pkgSourceList.
+ pyPkgIndexFile->NoDelete = true;
return pyPkgIndexFile;
}