[py] check if filter was created before deleting it
authorPaul Brossier <piem@piem.org>
Fri, 21 Dec 2018 14:26:04 +0000 (15:26 +0100)
committerPaul Brossier <piem@piem.org>
Fri, 21 Dec 2018 14:26:04 +0000 (15:26 +0100)
python/ext/py-filter.c

index e10a8ed..861f8cd 100644 (file)
@@ -109,7 +109,8 @@ static void
 Py_filter_del (Py_filter * self)
 {
   Py_XDECREF(self->out);
-  del_aubio_filter (self->o);
+  if (self->o)
+    del_aubio_filter (self->o);
   Py_TYPE(self)->tp_free ((PyObject *) self);
 }