From 05deaaf12022887762606421e612b18045f5270c Mon Sep 17 00:00:00 2001 From: adamjhn Date: Mon, 4 Sep 2023 22:33:38 +0200 Subject: [PATCH] Bugfix: Allow result of python call from rxd include flux to be free'd. (#2488) This should fix an issue from the forum, where scaling a simple model to include more fluxes over a longer simulation fails; https://www.neuron.yale.edu/phpBB/viewtopic.php?t=4631 --- src/nrnpython/rxd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nrnpython/rxd.cpp b/src/nrnpython/rxd.cpp index a182438174..a8a1b25ec4 100644 --- a/src/nrnpython/rxd.cpp +++ b/src/nrnpython/rxd.cpp @@ -334,6 +334,7 @@ void apply_node_flux(int n, PyErr_SetString(PyExc_Exception, "node._include_flux callback did not return a number.\n"); } + Py_DECREF(result); } } else { PyErr_SetString(PyExc_Exception, "node._include_flux unrecognised source term.\n");