History

python/: use Py_RETURN_NONE, fixing a memory bug triggered after opening many sinks

Paul Brossier committed 13 years ago

Commit 9e6695d1 parent 90a8f2f5 files · +21 −12Browse files

Showing the changes to python/ext (3 of 5 files). Show all

Unified · Split

3 files
  1. python/ext/aubiomodule.c +1 −1
  2. python/ext/py-filter.c +3 −3
  3. python/ext/py-filterbank.c +3 −3
python/ext/aubiomodule.c+1−1
@@ -164,7 +164,7 @@ Py_min_removal(PyObject * self, PyObject * args) · 163 unmodified lines
164 fvec_min_removal (vec);164 fvec_min_removal (vec);
165 165
166 // since this function does not return, we could return None166 // since this function does not return, we could return None
167 //return Py_None;167 //Py_RETURN_NONE;
168 // however it is convenient to return the modified vector168 // however it is convenient to return the modified vector
169 return (PyObject *) PyAubio_CFvecToArray(vec);169 return (PyObject *) PyAubio_CFvecToArray(vec);
170 // or even without converting it back to an array170 // or even without converting it back to an array
python/ext/py-filter.c+3−3
@@ -99,7 +99,7 @@ Py_filter_set_c_weighting (Py_filter * self, PyObject *args) · 98 unmodified lines
99 "error when setting filter to C-weighting");99 "error when setting filter to C-weighting");
100 return NULL;100 return NULL;
101 }101 }
102 return Py_None;102 Py_RETURN_NONE;
103}103}
104 104
105static PyObject * 105static PyObject *
@@ -117,7 +117,7 @@ Py_filter_set_a_weighting (Py_filter * self, PyObject *args) · 11 unmodified lines
117 "error when setting filter to A-weighting");117 "error when setting filter to A-weighting");
118 return NULL;118 return NULL;
119 }119 }
120 return Py_None;120 Py_RETURN_NONE;
121}121}
122 122
123static PyObject *123static PyObject *
@@ -135,7 +135,7 @@ Py_filter_set_biquad(Py_filter * self, PyObject *args) · 11 unmodified lines
135 "error when setting filter with biquad coefficients");135 "error when setting filter with biquad coefficients");
136 return NULL;136 return NULL;
137 }137 }
138 return Py_None;138 Py_RETURN_NONE;
139}139}
140 140
141static PyMemberDef Py_filter_members[] = {141static PyMemberDef Py_filter_members[] = {
python/ext/py-filterbank.c+3−3
@@ -109,7 +109,7 @@ Py_filterbank_set_triangle_bands (Py_filterbank * self, PyObject *args) · 108 unmodified lines
109 "error when setting filter to A-weighting");109 "error when setting filter to A-weighting");
110 return NULL;110 return NULL;
111 }111 }
112 return Py_None;112 Py_RETURN_NONE;
113}113}
114 114
115static PyObject *115static PyObject *
@@ -128,7 +128,7 @@ Py_filterbank_set_mel_coeffs_slaney (Py_filterbank * self, PyObject *args) · 12 unmodified lines
128 "error when setting filter to A-weighting");128 "error when setting filter to A-weighting");
129 return NULL;129 return NULL;
130 }130 }
131 return Py_None;131 Py_RETURN_NONE;
132}132}
133 133
134static PyObject *134static PyObject *
@@ -158,7 +158,7 @@ Py_filterbank_set_coeffs (Py_filterbank * self, PyObject *args) · 23 unmodified lines
158 "error when setting filter coefficients");158 "error when setting filter coefficients");
159 return NULL;159 return NULL;
160 }160 }
161 return Py_None;161 Py_RETURN_NONE;
162}162}
163 163
164static PyObject *164static PyObject *

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