I have a Thread class like bellow
class Thread {
public:
Thread();
~Thread();
void start();
void stop();
}
So i need to call destructor
Yes
delete this;
But be careful. You should not use the deleted object, this
and non-static members anymore.
Another way is to call destructor
~Thread();
But the question is, why do you need call the destructor?! It's not logical. You can write a code to manage the resources in a private method and call it.