History

python/ext/py-source.c: fix memory leak (see #18)

Paul Brossier committed 10 years ago

Commit 26eb6d01 parent 5652a8c1 file · +6 −6Browse files

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

Unified · Split

python/ext/py-source.c+6−6
@@ -184,9 +184,9 @@ Py_source_do(Py_source * self, PyObject * args) · 183 unmodified lines
184 /* compute _do function */184 /* compute _do function */
185 aubio_source_do (self->o, self->read_to, &read);185 aubio_source_do (self->o, self->read_to, &read);
186 186
187 PyObject *outputs = PyList_New(0);187 PyObject *outputs = PyTuple_New(2);
188 PyList_Append( outputs, (PyObject *)PyAubio_CFvecToArray (self->read_to));188 PyTuple_SetItem( outputs, 0, (PyObject *)PyAubio_CFvecToArray (self->read_to) );
189 PyList_Append( outputs, (PyObject *)PyLong_FromLong(read));189 PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));
190 return outputs;190 return outputs;
191}191}
192 192
@@ -211,9 +211,9 @@ Py_source_do_multi(Py_source * self, PyObject * args) · 18 unmodified lines
211 /* compute _do function */211 /* compute _do function */
212 aubio_source_do_multi (self->o, self->mread_to, &read);212 aubio_source_do_multi (self->o, self->mread_to, &read);
213 213
214 PyObject *outputs = PyList_New(0);214 PyObject *outputs = PyTuple_New(2);
215 PyList_Append( outputs, (PyObject *)PyAubio_CFmatToArray (self->mread_to));215 PyTuple_SetItem( outputs, 0, (PyObject *)PyAubio_CFmatToArray (self->mread_to));
216 PyList_Append( outputs, (PyObject *)PyLong_FromLong(read));216 PyTuple_SetItem( outputs, 1, (PyObject *)PyLong_FromLong(read));
217 return outputs;217 return outputs;
218}218}
219 219

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