Not at all. precautionary measure should be taken while cleaning up the objects
which were created in constructor. suppose you have a clean up function and you
can call from destructor to cleanup allocated memory.
it is good to call from destructor because you can call same cleanup function
during runtime for different reason reason.
MyClass::~MyClass() {
reset();
cleanup();
}
void MyClass::cleanup() {
if(myBuff != NULL)
delete []myBuff;
}
you can call cleanup from other part of class also to delete the buffer.
--- In [email protected], Sudipta Deb <dsudipta.1...@...> wrote:
>
> Hi,
>
> I have a doubt. I know that the destructor can call virtual member function.
> But can somebody please tell me is there any problem if destructor do the
> same?
>
> With regards,
> Sudipta
>
>
>
>
> [Non-text portions of this message have been removed]
>