Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -140,9 +140,8 @@ Py_source_init (Py_source * self, PyObject * args, PyObject * kwds) · 139 unmodified lines | ||
| 140 | 140 | { |
| 141 | 141 | self->o = new_aubio_source ( self->uri, self->samplerate, self->hop_size ); |
| 142 | 142 | 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); | |
| 146 | 145 | return -1; |
| 147 | 146 | } |
| 148 | 147 | self->samplerate = aubio_source_get_samplerate ( self->o ); |
| @@ -160,8 +159,10 @@ Py_source_init (Py_source * self, PyObject * args, PyObject * kwds) · 11 unmodified lines | ||
| 160 | 159 | static void |
| 161 | 160 | Py_source_del (Py_source *self, PyObject *unused) |
| 162 | 161 | { |
| 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 | + } | |
| 165 | 166 | Py_XDECREF(self->read_to); |
| 166 | 167 | Py_XDECREF(self->mread_to); |
| 167 | 168 | Py_TYPE(self)->tp_free((PyObject *) self); |