Click here to Skip to main content
15,917,731 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: resource leak in this case? Pin
Maxwell Chen12-Mar-08 22:15
Maxwell Chen12-Mar-08 22:15 
GeneralRe: resource leak in this case? Pin
George_George12-Mar-08 22:34
George_George12-Mar-08 22:34 
AnswerRe: resource leak in this case? Pin
Maxwell Chen12-Mar-08 22:39
Maxwell Chen12-Mar-08 22:39 
GeneralRe: resource leak in this case? Pin
George_George12-Mar-08 22:51
George_George12-Mar-08 22:51 
AnswerRe: resource leak in this case? Pin
Maxwell Chen12-Mar-08 22:54
Maxwell Chen12-Mar-08 22:54 
GeneralRe: resource leak in this case? Pin
George_George12-Mar-08 23:01
George_George12-Mar-08 23:01 
AnswerRe: resource leak in this case? [modified] Pin
Maxwell Chen12-Mar-08 23:11
Maxwell Chen12-Mar-08 23:11 
GeneralRe: resource leak in this case? Pin
George_George13-Mar-08 0:52
George_George13-Mar-08 0:52 
Thanks Maxwell,


It just mentioned in the reverse order of construction. Not mentioning the order of construction in the link you referred.

I have found the initialization order below. I think it means construction of member variables before the completion of constructor of current object. I think it also means the construction of member variables are before construction of current object.

So, the reverse order should be, destruct current object, then destruct member variables. Right?

--------------------
12.6.2 Initializing bases and members [class.base.init]

Initialization shall proceed in the following order:
— First, and only for the constructor of the most derived class as described below, virtual base classes shall
be initialized in the order they appear on a depth-first left-to-right traversal of the directed acyclic graph
of base classes, where “left-to-right” is the order of appearance of the base class names in the derived
class base-specifier-list.
— Then, direct base classes shall be initialized in declaration order as they appear in the base-specifier-list
(regardless of the order of the mem-initializers).
— Then, nonstatic data members shall be initialized in the order they were declared in the class definition
(again regardless of the order of the mem-initializers).
— Finally, the body of the constructor is executed.
[Note: the declaration order is mandated
--------------------


regards,
George
QuestionRe: resource leak in this case? Pin
Maxwell Chen13-Mar-08 8:47
Maxwell Chen13-Mar-08 8:47 
GeneralRe: resource leak in this case? Pin
George_George13-Mar-08 14:55
George_George13-Mar-08 14:55 
Generalincompatbilties between C and C++ ins aignment Pin
ForNow12-Mar-08 14:52
ForNow12-Mar-08 14:52 
GeneralRe: incompatbilties between C and C++ ins aignment Pin
Blake Miller13-Mar-08 11:25
Blake Miller13-Mar-08 11:25 
GeneralRe: incompatbilties between C and C++ ins aignment Pin
ForNow13-Mar-08 12:51
ForNow13-Mar-08 12:51 
GeneralCListCtrl Prevent Column Resizing Pin
JBAK_CP12-Mar-08 7:08
JBAK_CP12-Mar-08 7:08 
GeneralRe: CListCtrl Prevent Column Resizing Pin
David Crow12-Mar-08 7:42
David Crow12-Mar-08 7:42 
GeneralRe: CListCtrl Prevent Column Resizing Pin
sheshidar12-Mar-08 18:17
sheshidar12-Mar-08 18:17 
GeneralUDP socket Pin
nahitan12-Mar-08 5:53
nahitan12-Mar-08 5:53 
GeneralRe: UDP socket Pin
Mark Salsbery12-Mar-08 5:57
Mark Salsbery12-Mar-08 5:57 
GeneralRe: UDP socket Pin
Eytukan12-Mar-08 6:25
Eytukan12-Mar-08 6:25 
GeneralRe: UDP socket Pin
Moak13-Mar-08 15:05
Moak13-Mar-08 15:05 
GeneralRe: UDP socket Pin
nahitan17-Mar-08 5:20
nahitan17-Mar-08 5:20 
GeneralRe: UDP socket Pin
Moak17-Mar-08 6:36
Moak17-Mar-08 6:36 
Generalbehavior of strlen() [modified] Pin
koumodaki12-Mar-08 5:27
koumodaki12-Mar-08 5:27 
GeneralRe: behavior of strlen() modified Pin
Rajkumar R12-Mar-08 5:33
Rajkumar R12-Mar-08 5:33 
GeneralRe: behavior of strlen() Pin
koumodaki12-Mar-08 5:36
koumodaki12-Mar-08 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.