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

Fix memory leaks identified in testing. #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aronhelser
Copy link
Contributor

The cleaver API prevents me from using std::vector<std::unique_ptr<...>> to manage FloatField and its data() so I decided to delete them manually.

@aronhelser aronhelser requested a review from jcfr April 18, 2022 19:45
@@ -541,6 +541,13 @@ int vtkCleaverImageToUnstructuredGridFilter::RequestData(vtkInformation* vtkNotU
// mesh->writeInfo(output_path + output_name, verbose);
fillUnstructuredGrid(output, mesh);

// clean up memory
for(auto* field: fields)
Copy link
Member

Choose a reason for hiding this comment

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

The field pointers in this vector are new'ed up manually in both segmentationToIndicatorFunctions and loadIndicatorFunctions--why can't these functions return vectors of unique_ptrs themselves? That's your code, not the cleaver API.

@dcwhite dcwhite requested a review from jessdtate August 11, 2023 05:07
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.

3 participants