Mail Archives: cygwin-developers/1998/03/25/15:23:29
At 06:39 PM 3/24/98 -0800, Geoffrey Noer wrote:
>I've been cleaning up warnings generated by compiling cygwin32 with
>-Wall. One of them is that fhandler.h declares virtual functions but
>has a non-virtual destructor.
>
>Should I make ~fhandler_base virtual? I *think* it's not necessary
>but wouldn't hurt either. The function set_name (which is the only
>thing that calls new and thus needs the destructor) is only called by
>fhandler_base functions.
>
>--
>Geoffrey Noer
>noer AT cygnus DOT com
>
I haven't looked at fhandler_base but assuming its name is indicative of
its function and the fact that there are virtual functions on this class,
a virtual destructor is recommended. In general, if a class is a base
class, its destructor should be virtual. Also, there is no harm in making
a destructor virtual even if the class is not a base class (or isn't "yet").
Larry Hall lhall AT rfk DOT com
RFK Partners, Inc. (781) 239-1053
8 Grove Street (781) 239-1655 - FAX
Wellesley, MA 02181 http://www.rfk.com
- Raw text -