TITLE: Explicit destructor calls PROBLEM: heilig@plains.NoDak.edu (Zachary Heilig) I saw the previous thread about calling the destructor in member functions, and was wondering how legal the following code would be: void foo::remove( int call_destruct ) { if( call_destruct ) delete this; } or, should I just call the destructor function? any ideas? RESPONSE: rmartin@thor.Rational.COM (Bob Martin) The syntax is correct, but the practice is ill-advised. There are some possible ambiguities when an object deletes itself. They have to do with the fact that the member function for that object is still executing, even though the object has been destroyed. If any of the objects variables, or its vtbl, get accessed on the way out of the call, then trouble can ensue. So your best bet is never to use the structure: delete this. (And also avoid goto) By the way, calling the destructor is also legal syntax: foo::~foo(); But the result may not be what you expect. Calling the destructor executes the code that you wrote for the destructor, but it does not destroy the object. Moreover, when the object is finally destroyed, the destructor will be called again. So, take care.