[arch-commits] Commit in pyalpm/trunk (PKGBUILD memleak.patch)
Jelle van der Waa
jelle at archlinux.org
Tue Jun 1 13:25:28 UTC 2021
Date: Tuesday, June 1, 2021 @ 13:25:28
Author: jelle
Revision: 416931
upgpkg: pyalpm 0.10.2-1
Modified:
pyalpm/trunk/PKGBUILD
Deleted:
pyalpm/trunk/memleak.patch
---------------+
PKGBUILD | 2 +-
memleak.patch | 44 --------------------------------------------
2 files changed, 1 insertion(+), 45 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-06-01 11:40:26 UTC (rev 416930)
+++ PKGBUILD 2021-06-01 13:25:28 UTC (rev 416931)
@@ -1,7 +1,7 @@
# Maintainer : Rémy Oudompheng <remy at archlinux.org>
pkgname=pyalpm
-pkgver=0.10.1
+pkgver=0.10.2
pkgrel=1
pkgdesc="Python 3 bindings for libalpm"
arch=('x86_64')
Deleted: memleak.patch
===================================================================
--- memleak.patch 2021-06-01 11:40:26 UTC (rev 416930)
+++ memleak.patch 2021-06-01 13:25:28 UTC (rev 416931)
@@ -1,44 +0,0 @@
-From c02555c5d83e63b1a308e7c165d5615198e6d813 Mon Sep 17 00:00:00 2001
-From: Jelle van der Waa <jelle at vdwaa.nl>
-Date: Wed, 16 Jan 2019 09:30:28 +0100
-Subject: src: dealloc alpm_handle when object goes out of scope
-
-By default alpm_handle is leaked when Handle is out of scope since
-alpm_release is never called. Call alpm_release in tp_dealloc to
-actually free the alloc'd memory.
----
- src/handle.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/src/handle.c b/src/handle.c
-index 08853f0..5e196df 100644
---- a/src/handle.c
-+++ b/src/handle.c
-@@ -377,6 +377,16 @@ static PyMethodDef pyalpm_handle_methods[] = {
- {NULL, NULL, 0, NULL},
- };
-
-+static void pyalpm_dealloc(PyObject* self) {
-+ alpm_handle_t *handle = ALPM_HANDLE(self);
-+ int ret = alpm_release(handle);
-+ if (ret == -1) {
-+ PyErr_Format(alpm_error, "unable to release alpm handle");
-+ }
-+ handle = NULL;
-+ Py_TYPE(self)->tp_free((PyObject *)self);
-+}
-+
- PyTypeObject AlpmHandleType = {
- PyVarObject_HEAD_INIT(NULL, 0)
- "alpm.Handle", /*tp_name*/
-@@ -387,6 +397,7 @@ PyTypeObject AlpmHandleType = {
- .tp_methods = pyalpm_handle_methods,
- .tp_getset = pyalpm_handle_getset,
- .tp_new = pyalpm_initialize,
-+ .tp_dealloc = (destructor) pyalpm_dealloc,
- };
-
- /** Initializes Handle class in module */
---
-cgit v1.2.1-1-g437b
-
More information about the arch-commits
mailing list