From 704a039393c6b9bf990f1c99befd2555ad41f16f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 12 Jul 2009 15:44:32 +0200 Subject: 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. --- python/pkgsrcrecords.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python/pkgsrcrecords.cc') 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(Self,&PackageIndexFileType, + CppOwnedPyObject *PyObj; + PyObj = CppOwnedPyObject_NEW(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*) { -- cgit v1.2.3