Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!nosc!cod!mball From: mball@cod.NOSC.MIL (Michael S. Ball) Newsgroups: comp.lang.c++ Subject: Re: Virtual destructors Keywords: virtual destructor portability Message-ID: <1430@cod.NOSC.MIL> Date: 1 Mar 89 05:20:11 GMT References: <551@hrc63.co.uk> Reply-To: mball@cod.nosc.mil.UUCP (Michael S. Ball) Organization: Naval Ocean Systems Center, San Diego Lines: 21 In article <551@hrc63.co.uk> pj@hrc63.co.uk (Mr P Johnson "Baddow") writes: >In Oregon C++ (for Suns) v 1.1, it is possible to declare the base destructor >as virtual. This then ensures that the appropriate destructor is called for >any derived classes provided that the _derived_class_has_a_destructor_. If >the derived class has no explicit destructor then any member destructors will >not be called (rather than being called implicitly as they would be normally). I believe this is a bug. I will check on it and see that it gets handled if it is. This is the first time it has been reported, and it's not a well-defined area of the language. On logical grounds, though, it seems that if the base class destructor is virtual the one generated for the derived class should be as well. Thanks for pointing it out. If it turns out that the derived class shouldn't be virtual, I'll make another posting on the subject. Mike Ball TauMetric Corporation 1094 Cudahy Place., Ste 302 San Diego, CA 92110 mball@cod.nosc.mil