Skip to content

Fix memory leak in Oxidation model - #157

Merged
FilipovicLado merged 11 commits into
masterfrom
workflows
Jun 23, 2026
Merged

Fix memory leak in Oxidation model#157
FilipovicLado merged 11 commits into
masterfrom
workflows

Conversation

@FilipovicLado

Copy link
Copy Markdown
Member

Summary

  • Fix shared_ptr cycle in lsOxidation.hpp: OxidationDeformation and OxidationMaskBending held strong references to each other, leaking the entire object pair on every LOCOS time step. Fixed by calling clearMaskVelocityField() in ~Oxidation() and at the start of solveFields to break the cycle before members are replaced or destroyed.
  • Fix vtkIdList leak in lsWriteVisualizationMesh.hpp: vtkSmartPointer<vtkIdList> = vtkIdList::New() double-increments the refcount (once in New(), once in the vtkSmartPointer raw-pointer constructor), so the object is never freed. Changed to vtkSmartPointer<vtkIdList>::New() which uses TakeReference internally.
  • Add LSan suppression file (tests/lsan_suppressions.txt): Suppresses known false positives — VTK 9.1 internal leak in vtkGeometryFilterHelper and OpenMP thread-pool initialization under musl libc.
  • Wire suppression file into MultiSurfaceMesh and VisualizationMesh tests: Sets LSAN_OPTIONS automatically when VIENNALS_ENABLE_SANITIZER=ON so these VTK-dependent tests pass cleanly under sanitizer.

@FilipovicLado
FilipovicLado merged commit 8b6cfac into master Jun 23, 2026
36 checks passed
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.

1 participant