From cd4dd0427591d6357d875f881573b0b57bc0ae31 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 12 Jul 2009 13:57:23 +0200 Subject: python/sourcelist.cc: Do not delete the pkgIndexFile*, it is managed elsewhere. --- python/sourcelist.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python/sourcelist.cc') 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(Self); PyObject *pyPkgFileIter; - PyObject *pyPkgIndexFile; + CppOwnedPyObject *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(pyPkgFileIter,&PackageIndexFileType,index); + // Do not delete the pkgIndexFile*, it is managed by pkgSourceList. + pyPkgIndexFile->NoDelete = true; return pyPkgIndexFile; } -- cgit v1.2.3