diff --git a/imperative/python/src/ops.cpp b/imperative/python/src/ops.cpp index 4b6a443e166d86e9028f257cd5ef96f74546d2fa..30f61a0f6b8f802c19ffc52af4da3bb541cb740a 100644 --- a/imperative/python/src/ops.cpp +++ b/imperative/python/src/ops.cpp @@ -450,6 +450,7 @@ void _init_py_op_def(py::module m) { py_type.tp_richcompare = PyOp(OpDef)::tp_richcompare; py_type.tp_getset = py_op::py_getsetters; py_type.tp_repr = py_op::py_repr; + py_type.tp_dealloc = py_dealloc_generic; mgb_assert(PyType_Ready(&py_type) >= 0); m.add_object("OpDef", reinterpret_cast(&py_type)); }