diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 55ee0fa9a..913bb5c4b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,8 @@ - Allow ``color`` to be passed as an extra kwarg to ``plot_1d`` and ``plot_1d_to_axis``. Previously this caused a ``TypeError``. + - Fix bug where ``Py_None`` was not incremented before returning from + ``calculate_phonons()`` in the C-extension causing a deallocation crash `v1.2.0 `_ ------ diff --git a/c/_euphonic.c b/c/_euphonic.c index 2a93b2f7e..84ce901f4 100644 --- a/c/_euphonic.c +++ b/c/_euphonic.c @@ -300,7 +300,7 @@ static PyObject *calculate_phonons(PyObject *self, PyObject *args) { Py_DECREF(py_dipole_init_data); } - return Py_None; + Py_RETURN_NONE; } static PyMethodDef _euphonic_methods[] = {