Skip to content

Commit

Permalink
fix memory leak #131
Browse files Browse the repository at this point in the history
  • Loading branch information
QinbinLi committed Mar 24, 2019
1 parent d71b447 commit 5946a70
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/thundersvmScikit.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def __init__(self, kernel, degree,
# if self.max_mem_size != -1:
# thundersvm.set_memory_size(c_void_p(self.model), self.max_mem_size)

def __del__(self):
if self.model is not None:
thundersvm.model_free(c_void_p(self.model))

def label_validate(self, y):

return column_or_1d(y, warn=True).astype(np.float64)
Expand Down

0 comments on commit 5946a70

Please sign in to comment.