Philip Newton (pne) wrote,
Philip Newton
pne

  • Mood:

Word to the wise

Don't copy pointers to child objects (has-a relationship) in your operator =; sharing common children this way will bite you when you try to destroy your child objects and they've already been destroyed.

Fortunately, the STL implementation we use replaces internal pointers with "magic" nonsense values after the object is destroyed so you at least get a segfault and notice.

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments