Changeset 7876b67 for python/ext


Ignore:
Timestamp:
May 13, 2016, 5:22:32 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
ff89a06
Parents:
dee266f
Message:

python/ext/py-filterbank.c: fix error message formatting, do not delete if not created

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-filterbank.c

    rdee266f r7876b67  
    6060  self->o = new_aubio_filterbank (self->n_filters, self->win_s);
    6161  if (self->o == NULL) {
    62     char_t errstr[30];
    63     sprintf(errstr, "error creating filterbank with n_filters=%d, win_s=%d",
    64         self->n_filters, self->win_s);
    65     PyErr_SetString (PyExc_RuntimeError, errstr);
     62    PyErr_Format(PyExc_RuntimeError, "error creating filterbank with"
     63        " n_filters=%d, win_s=%d", self->n_filters, self->win_s);
    6664    return -1;
    6765  }
     
    7472Py_filterbank_del (Py_filterbank *self, PyObject *unused)
    7573{
    76   del_aubio_filterbank(self->o);
    77   Py_DECREF(self->out);
    78   free(self->coeffs.data);
     74  if (self->o) {
     75    free(self->coeffs.data);
     76    del_aubio_filterbank(self->o);
     77  }
     78  Py_XDECREF(self->out);
    7979  Py_TYPE(self)->tp_free((PyObject *) self);
    8080}
Note: See TracChangeset for help on using the changeset viewer.