The information in this article applies to:
SYMPTOMS
If new is defined as DEBUG_NEW and a call to new is made for a class that
takes a reference to another class in the member initialization, then the
destructor is not called for the referenced class for versions 4.0, 4.1,
and 4.2.
The destructor for ClassA is not called.NOTE: The Visual C++ 5.0 compiler generates the following error if you try to compile the sample code:
RESOLUTIONThe best way to work around the problem is to move the new statement to be within the body of the constructor. For example,
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Studio
97 Service Pack 3 and Visual C++ 6.0. Q170365 INFO: Visual Studio 97 Service Packs - What, Where, and Why MORE INFORMATIONSample Code
Additional query words:
Keywords : kbcode kbCodeGen kbCompiler kbCPPonly kbVC kbVC400bug kbVC410bug kbVC420bug kbVC500bug kbVC600fix kbVS97sp3fix |
Last Reviewed: September 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |