From 5c0e566605f9b3bdd108cb83625b6cd5837196c7 Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Wed, 4 Dec 2024 10:23:50 -0800 Subject: [PATCH] free pylist strong references at the end Signed-off-by: Jade Abraham --- modules/packages/Python.chpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/packages/Python.chpl b/modules/packages/Python.chpl index 644a077e0f57..f3d517ba40d3 100644 --- a/modules/packages/Python.chpl +++ b/modules/packages/Python.chpl @@ -647,7 +647,7 @@ module Python { const idx = res.domain.orderToIndex(i); var elm = PySequence_GetItem(obj, i); this.checkException(); - defer Py_DECREF(elm); + this.toFree.pushBack(elm); res[idx] = fromPython(res.eltType, elm); this.checkException(); } @@ -666,7 +666,7 @@ module Python { for i in 0..