FIX: Virtual Base Class Destructor Called More than Once (168936)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q168936 SYMPTOMS
If an exception is thrown from the constructor of a class that is derived
from a virtual base class, the destructor for the virtual base class is
called more than once. This doesn't happen if the exception is thrown from
any other member function.
RESOLUTION
There is no workaround. Avoid throwing exceptions from the constructor.
For additional information about the two-phased construction, please see the following
article in the Microsoft Knowledge Base: 132893 PRB: Exceptions Thrown During Construction Can Orphan Memory
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was corrected in Visual C++ version 6.0 for Windows.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbCompiler kbCPPonly kbfix kbVC600fix KB168936 |
---|
|