Deleting self object inside class
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3150942/c-delete-this">C++: Delete this?</a>  </p>
</blockquote>



<p>In C++, is it ok to delete the self object in function definition. What are side effects of this?</p>

<pre><code>class MyClass {

public:
    void ~myClass() {}
    void myFunction() { 
        // logic here
        delete this;
    }
}
</code></pre>

<p>Thanks!</p>
