Open stephanmg opened 3 years ago
Depending on your usage, yes you have. I looked into it and if a VariableArray or FixedArray contain non-simple classes (i.e. containing pointers) then resizing them sets the objects, and thus the pointers to zero but does not free memory allocated to them.
In this case his would happen if the outer VariableArray in 'ug::VariableArray2<ug::DenseMatrix<ug::VariableArray2
@anaegel this and other compiler warnings are produced by Navier-Stokes, maybe this is the origin of the memory leak you are looking for?
I made a branch with a (not yet functional) prototype-fix where I added a set_zero() function and changed resize() so that they work approbiately depending on the type. In this case I used c++17 as 'if constexpr' was not yet introduced.
I could try using c++11, but it would need quite a lot of code duplication using template templates, as a lot of specializations have to be covered. Maybe it is possible using variadic templates, but I am not fit in these.
See below.
Should I worry about this?
Stephan