summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-06-21 14:46:19 +0200
committerJulian Andres Klode <jak@debian.org>2009-06-21 14:46:19 +0200
commit6338b8abafaef4dcdcf852cab049124cc4ecce06 (patch)
tree9af735d615aa87a963016ac40b6eae23925a4308
parentb81133a92aa673d0d9315e9837012e59a988333a (diff)
downloadpython-apt-6338b8abafaef4dcdcf852cab049124cc4ecce06.tar.gz
python/acquire.cc, python/indexfile.cc: Do not delete the pointers for some objects.
We can not delete the AcquireFile object's pointer on deallocation because this would cause the item to be removed from the fetcher, which would be incompatible to the previous behaviour. We can not delete the IndexFile object's pointer on deallocation because it is managed by other objects like MetaIndex.
-rw-r--r--python/acquire.cc4
-rw-r--r--python/indexfile.cc4
2 files changed, 5 insertions, 3 deletions
diff --git a/python/acquire.cc b/python/acquire.cc
index d0549fd9..704ad0bd 100644
--- a/python/acquire.cc
+++ b/python/acquire.cc
@@ -354,7 +354,9 @@ PyTypeObject PkgAcquireFileType =
sizeof(CppOwnedPyObject<pkgAcqFile*>),// tp_basicsize
0, // tp_itemsize
// Methods
- CppOwnedDeallocPtr<pkgAcqFile*>, // tp_dealloc
+ // Not ..Ptr, because this would cause the item to be removed from the
+ // fetcher, which would be incompatible to previous behaviour.
+ CppOwnedDealloc<pkgAcqFile*>, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr
diff --git a/python/indexfile.cc b/python/indexfile.cc
index 78a4f513..ba709872 100644
--- a/python/indexfile.cc
+++ b/python/indexfile.cc
@@ -22,7 +22,6 @@ static PyObject *PackageIndexFileArchiveURI(PyObject *Self,PyObject *Args)
if (PyArg_ParseTuple(Args, "s",&path) == 0)
return 0;
-
return HandleErrors(Safe_FromString(File->ArchiveURI(path).c_str()));
}
@@ -99,7 +98,8 @@ PyTypeObject PackageIndexFileType =
sizeof(CppOwnedPyObject<pkgIndexFile*>), // tp_basicsize
0, // tp_itemsize
// Methods
- CppOwnedDeallocPtr<pkgIndexFile*>, // tp_dealloc
+ // Not ..Ptr, because the pointer is managed somewhere else.
+ CppOwnedDealloc<pkgIndexFile*>, // tp_dealloc
0, // tp_print
0, // tp_getattr
0, // tp_setattr