Create an Account
username: password:
 
  MemeStreams Logo

oh baby, copy it deep!

search

lclough
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

lclough's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
  MemeStreams
   Using MemeStreams
Current Events
  War on Terrorism
Science
  Math
  Nano Tech
Society
  Economics
  Philosophy
  Religion
Technology
  Computers
   Computer Security
   Cyber-Culture
   PC Hardware
   Human Computer Interaction
   Knowledge Management
   Computer Networking
  Military Technology
  High Tech Developments

support us

Get MemeStreams Stuff!


 
oh baby, copy it deep!
Topic: Miscellaneous 5:28 pm EDT, Apr 16, 2005

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!



 
 
Powered By Industrial Memetics
RSS2.0