Click here to Skip to main content
15,906,624 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Answer... or smart pointers Pin
Cedric Moonen26-Jun-07 3:47
Cedric Moonen26-Jun-07 3:47 
AnswerRe: Delete operator Pin
led mike26-Jun-07 5:23
led mike26-Jun-07 5:23 
GeneralRe: Delete operator Pin
tom groezer26-Jun-07 16:52
tom groezer26-Jun-07 16:52 
GeneralRe: Delete operator Pin
led mike27-Jun-07 4:45
led mike27-Jun-07 4:45 
Ok
tom groezer wrote:
How can I ensure that the memory allocated by new gets deleted even if if do not call a delete operator.


Then Cedric has given you the correct lead to the smart pointer[^]. However there are different models of smart pointers. There is one in STL called "auto_ptr" and there are others in the Boost library[^] that have different use models.

I recommend that you feel confident in your understanding of the different models before attempting to use them. Misuse of smart pointers can be worse than leaking memory.




QuestionPrivate functions Pin
tom groezer26-Jun-07 3:30
tom groezer26-Jun-07 3:30 
AnswerRe: Private functions Pin
Cedric Moonen26-Jun-07 3:38
Cedric Moonen26-Jun-07 3:38 
AnswerRe: Private functions Pin
Roger Stoltz26-Jun-07 3:57
Roger Stoltz26-Jun-07 3:57 
QuestionInline functions Pin
tom groezer26-Jun-07 3:18
tom groezer26-Jun-07 3:18 
AnswerRe: Inline functions Pin
Rajkumar R26-Jun-07 3:27
Rajkumar R26-Jun-07 3:27 
Questionhelp to solve this bug Pin
James_Programmer26-Jun-07 3:04
James_Programmer26-Jun-07 3:04 
AnswerRe: help to solve this bug Pin
Cedric Moonen26-Jun-07 3:15
Cedric Moonen26-Jun-07 3:15 
AnswerRe: help to solve this bug Pin
Iain Clarke, Warrior Programmer26-Jun-07 3:23
Iain Clarke, Warrior Programmer26-Jun-07 3:23 
GeneralRe: help to solve this bug Pin
James_Programmer26-Jun-07 3:48
James_Programmer26-Jun-07 3:48 
GeneralRe: help to solve this bug Pin
James_Programmer26-Jun-07 3:56
James_Programmer26-Jun-07 3:56 
GeneralRe: help to solve this bug Pin
Iain Clarke, Warrior Programmer26-Jun-07 4:33
Iain Clarke, Warrior Programmer26-Jun-07 4:33 
GeneralRe: help to solve this bug Pin
James_Programmer26-Jun-07 5:00
James_Programmer26-Jun-07 5:00 
GeneralRe: help to solve this bug Pin
James_Programmer26-Jun-07 5:14
James_Programmer26-Jun-07 5:14 
GeneralRe: help to solve this bug Pin
Iain Clarke, Warrior Programmer26-Jun-07 5:47
Iain Clarke, Warrior Programmer26-Jun-07 5:47 
GeneralRe: help to solve this bug Pin
James_Programmer26-Jun-07 6:01
James_Programmer26-Jun-07 6:01 
GeneralRe: help to solve this bug Pin
Mark Salsbery26-Jun-07 7:47
Mark Salsbery26-Jun-07 7:47 
Questionbrowse ... Pin
tasumisra26-Jun-07 2:33
tasumisra26-Jun-07 2:33 
AnswerRe: browse ... Pin
ahmad_ali26-Jun-07 6:45
ahmad_ali26-Jun-07 6:45 
GeneralRe: browse ... Pin
tasumisra26-Jun-07 20:52
tasumisra26-Jun-07 20:52 
GeneralRe: browse ... Pin
ahmad_ali26-Jun-07 22:55
ahmad_ali26-Jun-07 22:55 
QuestionData Types Pin
tasumisra26-Jun-07 1:34
tasumisra26-Jun-07 1:34 

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.