memory leak
gitforhf opened this issue · 0 comments
gitforhf commented
in emd.i
%typemap(freearg) signature_t * {
if ($1 != NULL) {
PyObject **features_array = (PyObject **) $1->Features;
int weights_count = (int)$1->n;
int i = 0;
for (i = 0; i < weights_count; ++i) {
Py_XDECREF(features_array[i]);
}
free((PyObject **) $1->Features);
free((float *) $1->Weights);
free((signature_t *) $1);
}
}