Re: How to override destructor?
On Tue, 21 Aug 2007 11:10:02 -0700, Jeff Dunlap
<JeffDunlap@discussions.microsoft.com> wrote:
I don't understand what I am doing wrong, I created a class derived from this
class:
// unmodified microsoft class
class CRequestHandlerT :
public TagReplacerType,
public CComObjectRootEx<ThreadModel>,
public IRequestHandlerImpl<THandler>
{
...
public:
...
~CRequestHandlerT() throw()
{
_ATLTRY
{
FreeHandlers(); // free handlers held by CTagReplacer
}
_ATLCATCHALL()
{
}
}
...
};
From within my subclass, I am attempting to override the destructor above:
class CLeadsBrowser
: public CRequestHandlerT<CLeadsBrowser>
{
...
public:
...
~CLeadsBrowser()
{
// I wish to add some cleanup code here
CRequestHandlerT::~CRequestHandlerT();
}
...
};
There's no need to call the base class destructor; the compiler calls it
for you at the end of your destructor.
--
Doug Harrison
Visual C++ MVP