History

python/ext/py-fft.c: improve error message, dont delete if not created

Paul Brossier committed 10 years ago

Commit 23982aa1 parent fcef3fd1 file · +8 −4Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/ext/py-fft.c+8−4
@@ -51,9 +51,11 @@ Py_fft_init (Py_fft * self, PyObject * args, PyObject * kwds) · 50 unmodified lines
51{51{
52 self->o = new_aubio_fft (self->win_s);52 self->o = new_aubio_fft (self->win_s);
53 if (self->o == NULL) {53 if (self->o == NULL) {
54 char_t errstr[30];54 PyErr_Format(PyExc_RuntimeError,
55 sprintf(errstr, "error creating fft with win_s=%d", self->win_s);55 "error creating fft with win_s=%d "
56 PyErr_SetString (PyExc_Exception, errstr);56 "(should be a power of 2 greater than 1; "
57 "try recompiling aubio with --enable-fftw3)",
58 self->win_s);
57 return -1;59 return -1;
58 }60 }
59 61
@@ -68,7 +70,9 @@ Py_fft_del (Py_fft *self, PyObject *unused) · 8 unmodified lines
68{70{
69 Py_XDECREF(self->doout);71 Py_XDECREF(self->doout);
70 Py_XDECREF(self->rdoout);72 Py_XDECREF(self->rdoout);
71 del_aubio_fft(self->o);73 if (self->o) {
74 del_aubio_fft(self->o);
75 }
72 Py_TYPE(self)->tp_free((PyObject *) self);76 Py_TYPE(self)->tp_free((PyObject *) self);
73}77}
74 78

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t