From e1a8d012c100dfab9ba7c8ad366e5609d884da5a Mon Sep 17 00:00:00 2001 From: Andrew Coffey Date: Sun, 3 Aug 2025 16:49:51 -0500 Subject: [PATCH 1/3] Updated patch versions of 3.9 and 3.13 in run-ubuntu-checks and added 3.14.0rc1 --- .github/workflows/run-ubuntu-checks.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-ubuntu-checks.yml b/.github/workflows/run-ubuntu-checks.yml index a428955efd..14878830b5 100644 --- a/.github/workflows/run-ubuntu-checks.yml +++ b/.github/workflows/run-ubuntu-checks.yml @@ -53,8 +53,9 @@ jobs: os: [ ubuntu-24.04 ] # check our min python (minor) version and our max python (minor) version python: [ - 3.9.21, - 3.13.1 + 3.9.23, + 3.13.5, + 3.14.0rc1 ] env: From e3dc06e3e6c81531402f9e884fe8bceaa53349be Mon Sep 17 00:00:00 2001 From: Andrew Coffey Date: Sun, 3 Aug 2025 20:07:12 -0500 Subject: [PATCH 2/3] Removed faulty xdecref for rect/frect --- src_c/rect_impl.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src_c/rect_impl.h b/src_c/rect_impl.h index 8bb5379258..dd6f3c0ee9 100644 --- a/src_c/rect_impl.h +++ b/src_c/rect_impl.h @@ -1929,12 +1929,9 @@ RectExport_clipline(RectObject *self, PyObject *const *args, Py_ssize_t nargs) } if (!RectImport_IntersectRectAndLine(rect, &x1, &y1, &x2, &y2)) { - Py_XDECREF(rect_copy); return PyTuple_New(0); } - Py_XDECREF(rect_copy); - PyObject *subtup1, *subtup2; subtup1 = TupleFromTwoPrimitives(x1, y1); if (!subtup1) { From 7d04091c57235c3571367e8872f7839eccf752f0 Mon Sep 17 00:00:00 2001 From: Andrew Coffey Date: Mon, 4 Aug 2025 05:40:21 -0500 Subject: [PATCH 3/3] Re-added XDECREF in rect clipline, but decref'ing the correct object --- src_c/rect_impl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src_c/rect_impl.h b/src_c/rect_impl.h index dd6f3c0ee9..adfcb7e61e 100644 --- a/src_c/rect_impl.h +++ b/src_c/rect_impl.h @@ -1869,6 +1869,7 @@ RectExport_clip(RectObject *self, PyObject *const *args, Py_ssize_t nargs) static PyObject * RectExport_clipline(RectObject *self, PyObject *const *args, Py_ssize_t nargs) { + PyObject *outer_rect = NULL; InnerRect *rect = &self->r, *rect_copy = NULL; PrimitiveType x1, y1, x2, y2; @@ -1918,7 +1919,8 @@ RectExport_clipline(RectObject *self, PyObject *const *args, Py_ssize_t nargs) if ((self->r.w < 0) || (self->r.h < 0)) { /* Make a copy of the rect so it can be normalized. */ - rect_copy = &pgRectAsRect(RectExport_RectNew(&self->r)); + outer_rect = RectExport_RectNew(&self->r); + rect_copy = &pgRectAsRect(outer_rect); if (rect_copy == NULL) { return RAISE(PyExc_MemoryError, "cannot allocate memory for rect"); @@ -1929,9 +1931,12 @@ RectExport_clipline(RectObject *self, PyObject *const *args, Py_ssize_t nargs) } if (!RectImport_IntersectRectAndLine(rect, &x1, &y1, &x2, &y2)) { + Py_XDECREF(outer_rect); return PyTuple_New(0); } + Py_XDECREF(outer_rect); + PyObject *subtup1, *subtup2; subtup1 = TupleFromTwoPrimitives(x1, y1); if (!subtup1) {