Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks fixes for unit tests #4036

Merged
merged 7 commits into from Dec 20, 2017

Conversation

geektoni
Copy link
Contributor

This patch fixes some memory leaks discovered by valgrind inside unit tests.

@@ -43,6 +43,7 @@ namespace shogun {
auto* cast = dynamic_cast<T*>(object);
if (!cast)
{
delete object;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catch!

@lisitsyn
Copy link
Member

looks good!

@codecov
Copy link

codecov bot commented Dec 20, 2017

Codecov Report

Merging #4036 into develop will decrease coverage by <.01%.
The diff coverage is 63.63%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4036      +/-   ##
===========================================
- Coverage    56.13%   56.13%   -0.01%     
===========================================
  Files         1361     1361              
  Lines        94254    94259       +5     
===========================================
+ Hits         52912    52914       +2     
- Misses       41342    41345       +3
Impacted Files Coverage Δ
src/shogun/base/progress.h 49.74% <0%> (-0.52%) ⬇️
src/shogun/base/class_list.h 66.66% <0%> (-8.34%) ⬇️
src/shogun/preprocessor/KernelPCA.cpp 73.68% <100%> (+1.64%) ⬆️
src/shogun/classifier/LDA.cpp 91.11% <75%> (-1.12%) ⬇️
src/shogun/distance/BrayCurtisDistance.cpp 96.55% <0%> (-3.45%) ⬇️
src/shogun/machine/LinearMachine.cpp 89.13% <0%> (-3.27%) ⬇️
src/shogun/optimization/liblinear/tron.cpp 86.61% <0%> (-0.71%) ⬇️
src/shogun/lib/external/shogun_libsvm.cpp 66.96% <0%> (+0.14%) ⬆️
src/shogun/lib/DataType.cpp 67.48% <0%> (+0.34%) ⬆️
src/shogun/lib/Map.h 83.33% <0%> (+0.98%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00b73c8...f9ac260. Read the comment docs.

@lisitsyn lisitsyn merged commit 76f3ad6 into shogun-toolbox:develop Dec 20, 2017
Copy link
Member

@karlnapf karlnapf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ace!

ktiefe pushed a commit to ktiefe/shogun that referenced this pull request Jul 30, 2019
* [ProgressBar] Fix uninitialized variables.

* [Valgrind] Fix memory leak inside create_object method.

* [LDA] Fix memory leak inside LDA.

* [KernelPCA] Fix memory leak inside unit test.

* [FisherLDA] Fix memory leak inside unit test (unit-FLDATest).

* [KRRNystrom] Fix memory leak inside unit test (unit-KRRNystrom).

* [clang-format] Fix style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants