Skip to content

Commit

Permalink
Unref input features in transformer::apply
Browse files Browse the repository at this point in the history
  • Loading branch information
vinx13 authored and vigsterkr committed Jun 4, 2018
1 parent 788b1cc commit d26eca7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/shogun/preprocessor/DensePreprocessor.cpp
Expand Up @@ -97,6 +97,7 @@ CFeatures* CDensePreprocessor<ST>::apply(CFeatures* features, bool inplace)
matrix = matrix.clone();
auto feat_matrix = apply_to_matrix(matrix);
auto preprocessed = new CDenseFeatures<ST>(feat_matrix);
SG_UNREF(features);
SG_REF(preprocessed);
return preprocessed;
}
Expand Down
1 change: 1 addition & 0 deletions src/shogun/preprocessor/SparsePreprocessor.h
Expand Up @@ -93,6 +93,7 @@ CFeatures* CSparsePreprocessor<ST>::apply(CFeatures* features, bool inplace)
apply_to_sparse_matrix(feature_matrix);

auto processed = new CSparseFeatures<ST>(feature_matrix);
SG_UNREF(features);
SG_REF(processed);

return processed;
Expand Down
1 change: 1 addition & 0 deletions src/shogun/preprocessor/StringPreprocessor.cpp
Expand Up @@ -106,6 +106,7 @@ namespace shogun

auto processed = new CStringFeatures<ST>(
string_list, string_features->get_alphabet());
SG_UNREF(features);
SG_REF(processed);

return processed;
Expand Down

0 comments on commit d26eca7

Please sign in to comment.