|
FhSim
3.1.0
Marine systems simulation
|
| Class | BUG |
| Severity | 1 |
| Status | ready |
Models: Net/NetStructure, Net/NetStructureWithConstraints
Found: 2026-09-30 review of f42360e..a6492d6 (four parallel correctness reviews)
Decision needed: —
NetStructure::~NetStructure (src/net/NetStructure.cpp:188) does not free m_VpNetElements, m_VpCableElements or m_aaiCableConn; NetStructureWithConstraints::~NetStructureWithConstraints (src/net/NetStructureWithConstraints.cpp:283) never deletes m_constraintSolver or m_jointConstr, and with MARE-0317 the solver owns its thread pool (when NumCpuCore > 1). Pre-existing.
Memory (and, with NumCpuCore > 1, pool threads) leak each time a model is built and destroyed: in tests and in hosts that rebuild models, not in a single run.
Own the elements and the solver with std::unique_ptr (the element classes are now non-copyable, MARE-0318).
Build and destroy a NetStructureWithConstraints with NumCpuCore = 2 under valgrind or LeakSanitizer: no leak and no thread left.
Low; watch for elements shared with the constraint solver.