Skip to content

Commit

Permalink
Merge pull request #44 from aldro61/memory_leak
Browse files Browse the repository at this point in the history
Memory leak. Solved issue #43
  • Loading branch information
aldro61 authored Apr 11, 2017
2 parents 209f908 + b1344b8 commit 3206313
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cpp_extensions/utility_python_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,17 @@ find_max(PyObject *self, PyObject *args){
opti_kinds_data[i] = (int) best_solution.best_feat_kind[i];
}

if (feature_weights){
Py_DECREF(feature_weights);
}
else{
delete [] feature_weights_data;
}

Py_DECREF(X);
Py_DECREF(y);
Py_DECREF(X_argsort_by_feature);
Py_DECREF(example_idx);

return Py_BuildValue("d,N,N,N",
opti_utility,
Expand Down

0 comments on commit 3206313

Please sign in to comment.