From f10c84eb9b91e62a545eb326da90194c502f023b Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Sun, 19 Jun 2016 16:04:01 +0100 Subject: [PATCH] Release format descriptor args before converting --- include/pybind11/numpy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 186b82f95..92ab11670 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -244,7 +244,7 @@ template struct npy_format_descriptor args["names"] = names; args["offsets"] = offsets; args["formats"] = formats; - if (!api.PyArray_DescrConverter_(args.ptr(), &descr_()) || !descr_()) + if (!api.PyArray_DescrConverter_(args.release().ptr(), &descr_()) || !descr_()) pybind11_fail("NumPy: failed to create structured dtype"); auto np = module::import("numpy"); auto empty = (object) np.attr("empty");