From f6a6bb741537890b46ed08049aee79d69405141b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sun, 25 Sep 2022 09:44:23 +0700 Subject: [PATCH] sip4: fix memleaks with Python 3.11 --- srcpkgs/sip4/patches/python-3.11.patch | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/srcpkgs/sip4/patches/python-3.11.patch b/srcpkgs/sip4/patches/python-3.11.patch index 6d60a5b239c..9fdc9acf35f 100644 --- a/srcpkgs/sip4/patches/python-3.11.patch +++ b/srcpkgs/sip4/patches/python-3.11.patch @@ -1,5 +1,7 @@ ---- a/siplib/sip.h -+++ b/siplib/sip.h +Index: sip-4.19.25/siplib/sip.h +=================================================================== +--- sip-4.19.25.orig/siplib/sip.h ++++ sip-4.19.25/siplib/sip.h @@ -1799,7 +1799,7 @@ typedef struct _sipAPIDef { int (*api_get_time)(PyObject *, sipTimeDef *); PyObject *(*api_from_time)(const sipTimeDef *); @@ -9,8 +11,10 @@ int (*api_check_plugin_for_type)(const sipTypeDef *, const char *); PyObject *(*api_unicode_new)(SIP_SSIZE_T, unsigned, int *, void **); void (*api_unicode_write)(int, void *, int, unsigned); ---- a/siplib/siplib.c -+++ b/siplib/siplib.c +Index: sip-4.19.25/siplib/siplib.c +=================================================================== +--- sip-4.19.25.orig/siplib/siplib.c ++++ sip-4.19.25/siplib/siplib.c @@ -448,7 +448,7 @@ static PyObject *sip_api_from_datetime(c static int sip_api_get_time(PyObject *obj, sipTimeDef *time); static PyObject *sip_api_from_time(const sipTimeDef *time); @@ -20,7 +24,7 @@ static int sip_api_check_plugin_for_type(const sipTypeDef *td, const char *name); static PyObject *sip_api_unicode_new(SIP_SSIZE_T len, unsigned maxchar, -@@ -13741,13 +13741,16 @@ static int sip_api_is_user_type(const si +@@ -13741,15 +13741,19 @@ static int sip_api_is_user_type(const si /* * Return a frame from the execution stack. */ @@ -39,4 +43,7 @@ + Py_DECREF(oframe); --depth; } ++ Py_XDECREF(frame); + return frame; + }