CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   release memory (https://www.cfd-online.com/Forums/openfoam-programming-development/218247-release-memory.html)

huaji2018 June 13, 2019 13:54

release memory
 
Hello,

When I use List or labelList to define an array, for example,

List <label> vars(3)

how to release its memory if I do not use it any more?

Hua

Zeppo June 14, 2019 15:40

Code:

vars.clear();
should do the trick
https://cpp.openfoam.org/v6/ListI_8H_source.html#l00124

huaji2018 June 15, 2019 06:05

Thank you!


All times are GMT -4. The time now is 11:48.