On Jul 3, 7:53*am, Pradeep Patra <smilesonisa...@gmail.com> wrote:
> Hi all,
> If I will declare the destructor as
> virtual will that cause any problem? like memory leak etc?
>
no. on the contrary, leaving your destructor non-virtual may cause
memory leaks. the only downside of declaring your destructor virtual
(since that would be the first virtual method in the class) is that
most likely the size of the objects of this class will become larger
by the size of the virtual pointer. I doubt it matters in 99.99% of
the cases though.
|