quote:Original post by UltimaX
Change the CLog deconstructor to virtual ~CLog(), like the singleton.
If a base class's member is declared as virtual, it will be resolved using the virtual function mechanism in the derived class(es) regardless of whether or not the keyword '
virtual
' is used again in the derived classes' declaration.
class Base{public: virtual ~Base(); // virtual...}; class Derived : public Base{public: ~Derived(); // virtual here, too...};
Incidentally, it's 'destructor', not a 'deconstructor'.
As Fruny implied, the correct destructors
should be being invoked correctly.
Also the order is different to what you stated, Austrian Coder.
CLog
's destructor is called first, and then
Singleton
's is called.
[
Google ||
Start Here ||
ACCU ||
STL ||
Boost ||
MSDN ||
GotW ||
MSVC++ Library Fixes ||
BarrysWorld ||
E-Mail Me ]
[edited by - Lektrix on September 1, 2003 6:05:26 PM]