diff options
Diffstat (limited to 'python/pkgsrcrecords.cc')
| -rw-r--r-- | python/pkgsrcrecords.cc | 6 |
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*) { |
