Changeset cd2791f


Ignore:
Timestamp:
May 11, 2016, 3:18:08 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:
c18bbef
Parents:
44312de
Message:

python/ext/py-source.c: fix error string, only delete if created

File:
1 edited

Legend:

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

    r44312de rcd2791f  
    141141  self->o = new_aubio_source ( self->uri, self->samplerate, self->hop_size );
    142142  if (self->o == NULL) {
    143     char_t errstr[30 + strlen(self->uri)];
    144     sprintf(errstr, "error creating source with %s", self->uri);
    145     PyErr_SetString (PyExc_RuntimeError, errstr);
     143    PyErr_Format (PyExc_RuntimeError, "error creating source with \"%s\"",
     144        self->uri);
    146145    return -1;
    147146  }
     
    161160Py_source_del (Py_source *self, PyObject *unused)
    162161{
    163   del_aubio_source(self->o);
    164   //del_fvec(self->read_to);
     162  if (self->o) {
     163    del_aubio_source(self->o);
     164    free(self->mread_to.data);
     165  }
    165166  Py_XDECREF(self->read_to);
    166167  Py_XDECREF(self->mread_to);
Note: See TracChangeset for help on using the changeset viewer.