www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/03/25/15:23:29

From: lhall AT rfk DOT com (Larry Hall)
Subject: Re: Mark ~fhandler_base virtual?
25 Mar 1998 15:23:29 -0800 :
Message-ID: <3.0.5.32.19980325090359.009c14b0.cygnus.cygwin32.developers@pop.ma.ultranet.com>
References: <199803250239 DOT SAA01986 AT skaro DOT cygnus DOT com>
Mime-Version: 1.0
To: Geoffrey Noer <noer AT cygnus DOT com>, cygwin32-developers AT cygnus DOT com
Cc: noer AT cygnus DOT com (Geoffrey Noer)

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019