summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-10-04 16:58:34 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-10-04 16:58:34 +0200
commitbbaa2f9da7a2df23dcb45a5c59bbd5ef9d65c392 (patch)
treed4f59944de41d97ae508ed847858f13018c65788
parent05ac4479d4a37ca55e892c588bcb217fa21ba20a (diff)
parent722f0d8b1a276f2f069fc090db2365ae2659fac9 (diff)
downloadpython-apt-bbaa2f9da7a2df23dcb45a5c59bbd5ef9d65c392.tar.gz
* fix incorrect PyMem_DEL() code
-rw-r--r--debian/changelog9
-rw-r--r--python/configuration.cc2
-rw-r--r--python/generic.h4
-rw-r--r--python/tag.cc2
4 files changed, 13 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index a0197cb4..a9fb92e5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+python-apt (0.6.19ubuntu7) edgy; urgency=low
+
+ * python/generic.h:
+ - fix incorrect use of PyMem_DEL(), use PyObject_DEL()
+ instead. This fixes a nasty segfault with python2.5
+ (lp: 63226)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 4 Oct 2006 16:45:53 +0200
+
python-apt (0.6.19ubuntu6) edgy; urgency=low
* python/progress.cc:
diff --git a/python/configuration.cc b/python/configuration.cc
index 6cf33581..55eac1bf 100644
--- a/python/configuration.cc
+++ b/python/configuration.cc
@@ -490,7 +490,7 @@ PyTypeObject ConfigurationPtrType =
sizeof(CppPyObject<Configuration *>), // tp_basicsize
0, // tp_itemsize
// Methods
- (destructor)PyMem_Free, // tp_dealloc
+ (destructor)PyObject_Free, // tp_dealloc
0, // tp_print
CnfGetAttr, // tp_getattr
0, // tp_setattr
diff --git a/python/generic.h b/python/generic.h
index b47ed1a2..a1b662bb 100644
--- a/python/generic.h
+++ b/python/generic.h
@@ -113,7 +113,7 @@ template <class T>
void CppDealloc(PyObject *Obj)
{
GetCpp<T>(Obj).~T();
- PyMem_DEL(Obj);
+ PyObject_DEL(Obj);
}
template <class T>
@@ -123,7 +123,7 @@ void CppOwnedDealloc(PyObject *iObj)
Obj->Object.~T();
if (Obj->Owner != 0)
Py_DECREF(Obj->Owner);
- PyMem_DEL(Obj);
+ PyObject_DEL(Obj);
}
inline PyObject *CppPyString(std::string Str)
diff --git a/python/tag.cc b/python/tag.cc
index 883a8eab..d0d862c9 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -68,7 +68,7 @@ void TagFileFree(PyObject *Obj)
Self->Object.~pkgTagFile();
Self->Fd.~FileFd();
Py_DECREF(Self->File);
- PyMem_DEL(Obj);
+ PyObject_DEL(Obj);
}
/*}}}*/