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

Fixed memory leak in DataContainer3D #5197

Merged
merged 1 commit into from Jan 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -144,6 +144,7 @@ bool DataContainer3D<DataT, Nx, Ny, Nz>::initFromFile(TFile& inpf, const char* n
return false;
}
mData = dataCont->mData;
delete dataCont;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the same should be done a few lines further down?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean the loadFromFile() function? There the pointer is just returned and I think shouldnt be deleted? But since this function is actually never used in any of the SpaceCharge classes, it might be better to just remove the function and keep the class more simple.

return true;
}

Expand Down