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!