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");