summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2019-01-08 13:52:28 +0100
committerSebastian Berg <sebastian@sipsolutions.net>2019-01-08 20:11:40 +0100
commit529e552be4b20c1545051ac6a192d61350e7c2e1 (patch)
tree6a58ba9b018857babb69e59dbd9a164c04389a21 /numpy
parente8918143bce960e4f1220a2a210edc2c0d7799d7 (diff)
downloadnumpy-529e552be4b20c1545051ac6a192d61350e7c2e1.tar.gz
BUG: Fix leak of void scalar buffer info
The vois scalar was missing the clearing logic for the buffer info cache (or storage). It should maybe be checked whether we can replace all of this logic when not supporting Python 2 anymore.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index 2f71c8ae9..52de31289 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -2599,6 +2599,8 @@ NPY_NO_EXPORT PyTypeObject PyGenericArrType_Type = {
static void
void_dealloc(PyVoidScalarObject *v)
{
+ _dealloc_cached_buffer_info((PyObject *)v);
+
if (v->flags & NPY_ARRAY_OWNDATA) {
npy_free_cache(v->obval, Py_SIZE(v));
}