Question about: FIX: Visual C++ Class Destructors Are Not Called in Reverse Order of Construction 
Author Message
 Question about: FIX: Visual C++ Class Destructors Are Not Called in Reverse Order of Construction

Does anyone have a more complete description of the behavior before and
after this fix?

Do we just need to compile against these dlls or do we have distribute them
as well?

FIX: Visual C++ Class Destructors Are Not Called in Reverse Order of
Construction

The information in this article applies to:

         Microsoft Visual C++ .NET (2002)

SYMPTOMS

When you call Visual C++ class destructors during stack unwinding (exception
handling), the class destructors are not called in reverse order of
construction.

RESOLUTION

Note You must rebuild your application after you install this fix.

A supported fix is now available from Microsoft, but it is only intended to
correct the problem that is described in this article. Apply it only to
computers that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to
obtain the fix. For a complete list of Microsoft Product Support Services
phone numbers and information about support costs, visit the following
Microsoft Web site:

http://www.*-*-*.com/ ;EN-US;CNTACTMS

NOTE: In special cases, charges that are ordinarily incurred for support
calls may be canceled if a Microsoft Support Professional determines that a
specific update will resolve your problem. The usual support costs will
apply to additional support questions and issues that do not qualify for the
specific update in question.

The English version of this fix has the file attributes (or later) that are
listed in the following table. The dates and times for these files are
listed in coordinated universal time (UTC). When you view the file
information, it is converted to local time. To find the difference between
UTC and local time, use the Time Zone tab in the Date and Time tool in
Control Panel.

   Date         Time   Version      Size       File name

   -----------------------------------------------------

   31-Jan-2003  19:56  13.0.9661.0  2,105,344  C1xx.dll

   31-Jan-2003  19:57  13.0.9661.0  1,753,088  C2.dll



Wed, 12 Oct 2005 03:23:47 GMT  
 Question about: FIX: Visual C++ Class Destructors Are Not Called in Reverse Order of Construction

Quote:

> Does anyone have a more complete description of the behavior before
> and after this fix?

I don't, sorry.  Presumably the behavior after the fix is C++ standards
conforming - the destructors being called in reverse order of construction.
I don't know what the behavior is before the fix though, or if there are
special circumstances necessary to see the non-conforming behavior.

Quote:

> Do we just need to compile against these dlls or do we have
> distribute them as well?

Those DLL's are the "guts" of the compiler - they're not redistributed.

-cd



Wed, 12 Oct 2005 03:48:43 GMT  
 Question about: FIX: Visual C++ Class Destructors Are Not Called in Reverse Order of Construction

Quote:

>Date: Fri, 25 Apr 2003 12:48:43 -0700


>> Does anyone have a more complete description of the behavior before
>> and after this fix?

>I don't, sorry.  Presumably the behavior after the fix is C++ standards
>conforming - the destructors being called in reverse order of construction.
>I don't know what the behavior is before the fix though, or if there are
>special circumstances necessary to see the non-conforming behavior.

>> Do we just need to compile against these dlls or do we have
>> distribute them as well?

>Those DLL's are the "guts" of the compiler - they're not redistributed.

>-cd

It's a particular code sequence, where you have two (or more) temporary
objects (objects created inside of an expression t;ree) where an exception
is thrown at some point during the evaluation of the expression, the
expression temps will be destroyed in the order of construction, instead of
reverse order of construction.  It will rarely cause any problems - all the
destructors are being called, just not always in the reverse order.  The
real trouble is that in the rare occurrence when it _does_  cause problems,
the problems are notoriously difficult to track down.  If your destructors
don't rely on other objects being constructed or destroyed in a particular
order, you won't have any problems.

--
Kevin Frei & Charles Park
Visual C++
This posting is provided "as is" with no warranties, and confers no rights.
Void where prohibited.



Sun, 16 Oct 2005 02:45:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Destructor in class not called when class goes out of scope

2. Help a Newbie at Visual C++ (I am not a newbie at C++)

3. Memo field problem not fixed in Visual C++ 4.2

4. destructor is called before copy-constructor on temporary class (allocated on stack during function call)

5. I am not able to see my database class members in class view - Please help

6. Visual C++ calling Visual C++ dll

7. Do Not Install Visual C++ 5.0 Over an Installation of Visual C++ 4.x

8. Derived class constructor does not appear in Object Browser in Visual C++ 6.0

9. CWindowImpl destructor not called

10. destructor not called on windows shutdown

11. Debug Error when calling a destructor from a class that's in a DLL

12. Destructors are not called when exception is thrown.

 

 
Powered by phpBB® Forum Software