Copy Constructors you are the thorn in my side. I spent nearly half an hour tracking done something that should have been apparent right way: If you have an object, which contains pointers to dynamic memory, adding to a vector (or any STL container) does a shallow copy! I needed a deep copy. I had some temp objects I was creating only to add them to an array, and then destory them. When they were destroyed, they would free the memory the object in the vector still referenced. Segmentation Fault ... sigh... at least its all billable hours. oh baby, copy it deep! |