CStringArray memory leak
Posted on 2004-03-26
I have created a CStringArray ar_Data within a function which is populated with a list of CStrings, for example 5 strings. I am constantly reusing the function and therefore the CStringArray to store different Strings, for example 7 strings, then 3strings, etc. My problem is that when I use the function ar_Data.RemoveAll(); it is not releasing the memory so eachtime I use the function the memory overhead increases. Can someone suggest a way to totally destroy the CStringArray and release the memory so it can be reused.