I have created a vector of objects that I am constantly changing, but I want to have a deconstructor to deallocate a string in each of the objects when I am done using the vector. I wrote a deconstructor but I noticed that it is getting called all over the place- even when I am not done using the memory. Is there something special about vectors that can account for this, and if so how do I deallocate the memory used in the string for each object in a vector?
Any suggestions would be great!