I am using a list template from the STL in BorlandC++ Builder and have a problem in that I can't get it to release the memory it uses once I reduce the size of the list. The documentation states I should do the following:
// Remove data from the list
list<MSData>::iterator result =
remove(MSList.begin(), MSList.end(), CompareType);
// Delete dangling elements from the list
MSList.erase(result, MSList.end());
The data I wish to delete is deleted but the memory that was used is not freed up. MSData is a class I generated and overrode the == operator, amongst others.