Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
QuestionRe: resource leak in this case? Pin
Maxwell Chen13-Mar-08 8:47
Maxwell Chen13-Mar-08 8:47 
George_George wrote:
It just mentioned in the reverse order of construction. Not mentioning the order of construction in the link you referred.


Hey, you only asked about resource leak, asked whether the destructors not being called, and asked the order of destruction. Why should I answer you the order of construction?! Confused | :confused:



George_George wrote:
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?


In your case, "yes", because your example constructs Goo member in the initialization list, which is earlier than Foo constructor.

  Maxwell Chen

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 
GeneralRe: behavior of strlen() Pin
Rajkumar R12-Mar-08 5:37
Rajkumar R12-Mar-08 5:37 

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.