Deleting self object inside class

Viewed 33998

Possible Duplicate:
C++: Delete this?

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

class MyClass {

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

Thanks!

5 Answers
Related