ref: 9e4e389fccbb102cb25f7ae7664ee5ede9036481
parent: 6f4f1175d685464c4646cd7d2bb4e5f49ef63468
author: Paul Brossier <piem@piem.org>
date: Wed May 4 09:16:44 EDT 2016
python/lib/gen_code.py: make sure aubio object has been created before deleting it
--- a/python/lib/gen_code.py
+++ b/python/lib/gen_code.py
@@ -353,7 +353,9 @@
{del_out}(self->{name});""".format(del_out = del_out, name = name)
del_fn = get_name(self.del_proto)
out += """
- {del_fn}(self->o);
+ if (self->o) {{
+ {del_fn}(self->o);
+ }}
Py_TYPE(self)->tp_free((PyObject *) self);
}}
""".format(del_fn = del_fn)