Click here to Skip to main content
15,560,073 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionStrange memory leak Pin
miniman0631-Oct-12 22:58
miniman0631-Oct-12 22:58 
AnswerRe: Strange memory leak Pin
Sivaraman Dhamodharan31-Oct-12 23:45
Sivaraman Dhamodharan31-Oct-12 23:45 
GeneralRe: Strange memory leak Pin
miniman061-Nov-12 0:10
miniman061-Nov-12 0:10 
AnswerRe: Strange memory leak Pin
Rolf Kristensen31-Oct-12 23:47
Rolf Kristensen31-Oct-12 23:47 
GeneralRe: Strange memory leak Pin
miniman061-Nov-12 0:11
miniman061-Nov-12 0:11 
AnswerRe: Strange memory leak Pin
Santhosh G_1-Nov-12 0:22
Santhosh G_1-Nov-12 0:22 
GeneralRe: Strange memory leak Pin
miniman061-Nov-12 0:31
miniman061-Nov-12 0:31 
AnswerRe: Strange memory leak Pin
Jochen Arndt1-Nov-12 0:35
professionalJochen Arndt1-Nov-12 0:35 
You are explicitly calling the destructor. This will free the allocated memory for the members but not the object itself. You should use delete instead:
C++
delete allo;

Or you may use auto delete (using an additional member var):
C++
Process::~Process()
{
    delete m_proc;
    if(m_filename) // this is not necessary
	delete [] m_filename;
    if (m_bAutoDelete)
        delete this;
}

GeneralRe: Strange memory leak Pin
miniman061-Nov-12 1:09
miniman061-Nov-12 1:09 
GeneralRe: Strange memory leak Pin
Jochen Arndt1-Nov-12 1:29
professionalJochen Arndt1-Nov-12 1:29 
AnswerRe: Strange memory leak Pin
BCN-1631-Nov-12 17:01
BCN-1631-Nov-12 17:01 
Questionabout accessing PDF file, compile error. Pin
BCN-16331-Oct-12 16:18
BCN-16331-Oct-12 16:18 
AnswerRe: about accessing PDF file, compile error. Pin
Richard MacCutchan1-Nov-12 0:41
mveRichard MacCutchan1-Nov-12 0:41 
GeneralRe: about accessing PDF file, compile error. Pin
BCN-1631-Nov-12 16:56
BCN-1631-Nov-12 16:56 
GeneralRe: about accessing PDF file, compile error. Pin
Richard MacCutchan1-Nov-12 23:35
mveRichard MacCutchan1-Nov-12 23:35 
GeneralRe: about accessing PDF file, compile error. Pin
BCN-1634-Nov-12 14:39
BCN-1634-Nov-12 14:39 
QuestionHow correctly to check up availability of a XP theme? Pin
Eugene Pustovoyt31-Oct-12 3:10
Eugene Pustovoyt31-Oct-12 3:10 
AnswerRe: How correctly to check up availability of a XP theme? Pin
Jochen Arndt31-Oct-12 3:54
professionalJochen Arndt31-Oct-12 3:54 
GeneralRe: How correctly to check up availability of a XP theme? Pin
Eugene Pustovoyt31-Oct-12 5:12
Eugene Pustovoyt31-Oct-12 5:12 
QuestionWhat is the difference between following declarations ? Pin
PrafullaVedante30-Oct-12 23:52
PrafullaVedante30-Oct-12 23:52 
AnswerRe: What is the difference between following declarations ? Pin
Richard MacCutchan31-Oct-12 0:07
mveRichard MacCutchan31-Oct-12 0:07 
AnswerRe: What is the difference between following declarations ? Pin
Orjan Westin31-Oct-12 0:37
professionalOrjan Westin31-Oct-12 0:37 
GeneralRe: What is the difference between following declarations ? Pin
Stefan_Lang7-Nov-12 3:49
mveStefan_Lang7-Nov-12 3:49 
GeneralRe: What is the difference between following declarations ? Pin
Orjan Westin8-Nov-12 10:07
professionalOrjan Westin8-Nov-12 10:07 
QuestionWrite a tiff file to disk Pin
Marcio Kugler Rodrigues30-Oct-12 8:50
Marcio Kugler Rodrigues30-Oct-12 8:50 

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.