Click here to Skip to main content
15,905,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CList destructor Pin
David Crow10-Apr-08 5:32
David Crow10-Apr-08 5:32 
GeneralRe: CList destructor Pin
piul10-Apr-08 5:26
piul10-Apr-08 5:26 
GeneralRe: CList destructor Pin
CPallini10-Apr-08 5:58
mveCPallini10-Apr-08 5:58 
GeneralRe: CList destructor Pin
bob1697210-Apr-08 8:23
bob1697210-Apr-08 8:23 
QuestionRe: CList destructor Pin
CPallini10-Apr-08 21:23
mveCPallini10-Apr-08 21:23 
GeneralRe: CList destructor Pin
bob1697211-Apr-08 18:31
bob1697211-Apr-08 18:31 
GeneralRe: CList destructor Pin
CPallini11-Apr-08 20:39
mveCPallini11-Apr-08 20:39 
GeneralRe: CList destructor Pin
Moak17-Apr-08 0:31
Moak17-Apr-08 0:31 
piul wrote:
Does anybody know if deleting pList frees all the allocated memory?


For each element created with new you need to call delete. Typically it looks like this: when you clear the list you iterate trough the list and call delete for each element in it and after that clear the list itself. Alternatively use a smart pointer[^] instead of a normal pointer -or- store elements instead of pointers (there is no need to store pointers in data containers).

Hope it helps.

/M


QuestionCan we have our application as _UNICODE supported as well _MBCS supported? Pin
ganesa moorthy10-Apr-08 4:56
ganesa moorthy10-Apr-08 4:56 
GeneralRe: Can we have our application as _UNICODE supported as well _MBCS supported? Pin
Mark Salsbery10-Apr-08 5:53
Mark Salsbery10-Apr-08 5:53 
GeneralRe: Can we have our application as _UNICODE supported as well _MBCS supported? Pin
led mike10-Apr-08 8:11
led mike10-Apr-08 8:11 
QuestionRe: Can we have our application as _UNICODE supported as well _MBCS supported? Pin
ganesa moorthy10-Apr-08 21:04
ganesa moorthy10-Apr-08 21:04 
GeneralRe: Can we have our application as _UNICODE supported as well _MBCS supported? Pin
Mark Salsbery11-Apr-08 5:48
Mark Salsbery11-Apr-08 5:48 
GeneralRe: Can we have our application as _UNICODE supported as well _MBCS supported? Pin
ganesa moorthy14-Apr-08 21:01
ganesa moorthy14-Apr-08 21:01 
QuestionListBox Pin
C++NewBe10-Apr-08 3:26
C++NewBe10-Apr-08 3:26 
QuestionRe: ListBox Pin
CPallini10-Apr-08 3:33
mveCPallini10-Apr-08 3:33 
GeneralRe: ListBox Pin
C++NewBe10-Apr-08 3:41
C++NewBe10-Apr-08 3:41 
GeneralRe: ListBox Pin
CPallini10-Apr-08 4:37
mveCPallini10-Apr-08 4:37 
GeneralRe: ListBox Pin
Cedric Moonen10-Apr-08 3:36
Cedric Moonen10-Apr-08 3:36 
GeneralRe: ListBox Pin
krmed10-Apr-08 3:43
krmed10-Apr-08 3:43 
AnswerRe: ListBox Pin
C++NewBe10-Apr-08 4:50
C++NewBe10-Apr-08 4:50 
GeneralRe: ListBox Pin
krmed10-Apr-08 4:55
krmed10-Apr-08 4:55 
GeneralRe: ListBox Pin
CPallini10-Apr-08 4:57
mveCPallini10-Apr-08 4:57 
GeneralRe: ListBox Pin
Hamid_RT11-Apr-08 7:17
Hamid_RT11-Apr-08 7:17 
QuestionRe: ListBox Pin
David Crow11-Apr-08 10:45
David Crow11-Apr-08 10:45 

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.