diff --git a/docs/project/changelog.md b/docs/project/changelog.md index 3ae7b6312..7ddb3eb04 100644 --- a/docs/project/changelog.md +++ b/docs/project/changelog.md @@ -36,6 +36,11 @@ substitutions: `PyProxy` (as introduced by {pr}`1636`) before destroying the root `PyProxy`. {pr}`1854` +- {{Fix}} Borrowed attribute `PyProxy`s are no longer destroyed when the root + `PyProxy` is garbage collected (because it was leaked). Doing so has no + benefit to nonleaky code and turns some leaky code into broken code (see + {issue}`1855` for an example). {pr}`1870` + ### pyodide-build - {{API}} By default only a minimal set of packages is built. To build all diff --git a/src/core/pyproxy.js b/src/core/pyproxy.js index 950181818..f43d6e9b7 100644 --- a/src/core/pyproxy.js +++ b/src/core/pyproxy.js @@ -31,7 +31,6 @@ Module.isPyProxy = isPyProxy; if (globalThis.FinalizationRegistry) { Module.finalizationRegistry = new FinalizationRegistry(([ptr, cache]) => { - pyproxy_decref_cache(cache); try { Module._Py_DecRef(ptr); } catch (e) {