[omniORB] non-virtual destructors

David Riddoch djr@uk.research.att.com
Thu, 16 Mar 2000 14:08:19 +0000 (GMT)


On Thu, 16 Mar 2000, Shawn Bisgrove wrote:

>    When compiling OmniOrb 3.0 prerelease March 16 on
> gcc-2.92.2 under Solaris 2.6, the compiler warns about
> three classes with virtual functions but non-virtual
> destructors for omniLocalIdentity, omniIdentity, and
> omniRemoteIdentity.  Is there an instance in the code
> where this could cause memory leaking? 

No.  This is perfectly legal c++ code, and in my opinion the compiler
should not issue a warning.  These objects are only ever 'delete'd through
a pointer to the most derived type -- so we are sure to call the correct
destructor.  The behaviour with virtual destructors is identical, but has
a space and time cost.

Cheers,
David