Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can GetAppData Path? Pin
SandipG 24-Sep-08 20:34
SandipG 24-Sep-08 20:34 
AnswerRe: How can GetAppData Path? Pin
ThatsAlok24-Sep-08 20:26
ThatsAlok24-Sep-08 20:26 
GeneralRe: How can GetAppData Path? Pin
Le@rner24-Sep-08 20:54
Le@rner24-Sep-08 20:54 
GeneralRe: How can GetAppData Path? Pin
ThatsAlok24-Sep-08 21:07
ThatsAlok24-Sep-08 21:07 
Questionstructure pointer deletion problem. Pin
SRKSHOME24-Sep-08 19:49
SRKSHOME24-Sep-08 19:49 
AnswerRe: structure pointer deletion problem. Pin
Cedric Moonen24-Sep-08 19:58
Cedric Moonen24-Sep-08 19:58 
GeneralRe: structure pointer deletion problem. Pin
ThatsAlok24-Sep-08 20:26
ThatsAlok24-Sep-08 20:26 
AnswerRe: structure pointer deletion problem. Pin
ThatsAlok24-Sep-08 20:05
ThatsAlok24-Sep-08 20:05 
SRKSHOME wrote:
pTreeData->ptext = new RWCString(debug->GetMessage());


this is creating memory leak, you have to first delete memeory allocated to ptext, then delete the main structure.

Since, when you allocate memory to structure object, it will allocate only 4 byte to ptext object since it is pointer and when you delete the structure pointer it will only delete the 4 byte, which it is allocated to the variable at the time of allocation not the memory you allocate to ptext variable.

Now, for saving your self from memory leak, it would advisable first to delete memory allocated to datamember then delete the structure object itself

"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixture


cheers,
Alok Gupta
VC Forum Q&A :- I/IV
Support CRY- Child Relief and You/xml>

QuestionHow can referesh a List Ctrl? Pin
Le@rner24-Sep-08 19:36
Le@rner24-Sep-08 19:36 
AnswerRe: How can referesh a List Ctrl? Pin
ThatsAlok24-Sep-08 19:55
ThatsAlok24-Sep-08 19:55 
GeneralRe: How can referesh a List Ctrl? Pin
Le@rner24-Sep-08 20:21
Le@rner24-Sep-08 20:21 
GeneralRe: How can referesh a List Ctrl? Pin
ThatsAlok24-Sep-08 20:51
ThatsAlok24-Sep-08 20:51 
GeneralRe: How can referesh a List Ctrl? Pin
Le@rner24-Sep-08 21:25
Le@rner24-Sep-08 21:25 
GeneralRe: How can referesh a List Ctrl? Pin
Roger Allen25-Sep-08 0:26
Roger Allen25-Sep-08 0:26 
GeneralRe: How can referesh a List Ctrl? Pin
Le@rner25-Sep-08 0:33
Le@rner25-Sep-08 0:33 
GeneralRe: How can referesh a List Ctrl? Pin
Roger Allen25-Sep-08 0:51
Roger Allen25-Sep-08 0:51 
Questionrestart system by code Pin
Madan Chauhan24-Sep-08 19:35
Madan Chauhan24-Sep-08 19:35 
AnswerRe: restart system by code Pin
ThatsAlok24-Sep-08 19:51
ThatsAlok24-Sep-08 19:51 
GeneralRe: restart system by code Pin
Madan Chauhan24-Sep-08 20:02
Madan Chauhan24-Sep-08 20:02 
GeneralRe: restart system by code Pin
ThatsAlok24-Sep-08 20:07
ThatsAlok24-Sep-08 20:07 
Questiongetting hard disk name Pin
VCProgrammer24-Sep-08 19:34
VCProgrammer24-Sep-08 19:34 
AnswerRe: getting hard disk name Pin
SandipG 24-Sep-08 20:21
SandipG 24-Sep-08 20:21 
AnswerRe: getting hard disk name Pin
Le@rner24-Sep-08 20:25
Le@rner24-Sep-08 20:25 
AnswerRe: getting hard disk name Pin
Madan Chauhan24-Sep-08 21:09
Madan Chauhan24-Sep-08 21:09 
QuestionChange Background colour of Group boxes Pin
Dhiraj kumar Saini24-Sep-08 18:54
Dhiraj kumar Saini24-Sep-08 18:54 

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.