summaryrefslogtreecommitdiff
path: root/python/pkgsrcrecords.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-12 15:44:32 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-12 15:44:32 +0200
commit704a039393c6b9bf990f1c99befd2555ad41f16f (patch)
tree3253543288ade5732a1568e355cbc6ff34067027 /python/pkgsrcrecords.cc
parentcd4dd0427591d6357d875f881573b0b57bc0ae31 (diff)
downloadpython-apt-704a039393c6b9bf990f1c99befd2555ad41f16f.tar.gz
python/pkgsrcrecords.cc: Do not delete the pkgIndexFile*, it is managed by PkgSrcRecords::Parser.
APT still has a bug which causes the index file to not be deleted, but we should prepare for the fix.
Diffstat (limited to 'python/pkgsrcrecords.cc')
-rw-r--r--python/pkgsrcrecords.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc
index 06fd4e3b..99711585 100644
--- a/python/pkgsrcrecords.cc
+++ b/python/pkgsrcrecords.cc
@@ -123,8 +123,12 @@ static PyObject *PkgSrcRecordsGetIndex(PyObject *Self,void*) {
if (Struct.Last == 0)
return 0;
const pkgIndexFile &tmp = Struct.Last->Index();
- return CppOwnedPyObject_NEW<pkgIndexFile*>(Self,&PackageIndexFileType,
+ CppOwnedPyObject<pkgIndexFile*> *PyObj;
+ PyObj = CppOwnedPyObject_NEW<pkgIndexFile*>(Self,&PackageIndexFileType,
(pkgIndexFile*)&tmp);
+ // Do not delete the pkgIndexFile*, it is managed by PkgSrcRecords::Parser.
+ PyObj->NoDelete=true;
+ return PyObj;
}
static PyObject *PkgSrcRecordsGetFiles(PyObject *Self,void*) {