[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

RE>Re- Constructor bombs f



Reply to:   RE>Re:  Constructor bombs for 
Hallelujah Brother!

  I think 95% of the cases where progress variables might be considered can be
easily handled by NULL'ing all the pointers >before< doing any further
construction, allowing the destructor to safely determine what should be thrown
away. (What Michael said...)

Foo::Foo () {
  pz = NULL;
  px = NULL;
  pz = zip ();
  px = zap ();
}
Foo::~Foo () {
  if (pz != NULL) {
    delete pz;
  }
  if (px != NULL) {
    delete px;
  }
}

--Hugh