title: C++ destructor with return
body: <p>In C++ if we define a class destructor as:</p>
  
  <pre><code>~Foo(){
     return;
  }
  </code></pre>
  
  <p>upon calling this destructor will the object of <code>Foo</code> be destroyed or does
  explicitly returning from the destructor mean that we don't ever want to destroy it.</p>
  
  <p>I want to make it so that a certain object is destroyed only through another objects destructor i.e. only when the other object is ready to be destroyed.</p>
  
  <p>Example:</p>
  
  <pre><code>class Class1{
  ...
  Class2* myClass2;
  ...
  };
  
  Class1::~Class1(){
      myClass2-&gt;status = FINISHED;
      delete myClass2;
  }
  
  Class2::~Class2(){
      if (status != FINISHED) return;
  }
  </code></pre>
  
  <p>I searched online and couldn't seem to find an answer to my question.
  I've also tried figuring it out myself by going through some code step by step with a debugger but can't get a conclusive result.</p>