Click here to Skip to main content
15,566,096 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Yes, you are right. That would result in a recursion. My code lacks resetting the m_bAutoDelete variable. It must be:
C++
Process::~Process()
{
    if (m_bAutoDelete)
    {
        m_bAutoDelete = false;
        delete this;
    }
    else
    {
        delete m_proc;
        delete [] m_filename;
        m_proc = NULL;
        m_filename = NULL;
    }
}

However, this is not a good solution because the destructor is called twice and this will fail if the object wasn't allocated using new.
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 
AnswerRe: Write a tiff file to disk Pin
Richard MacCutchan30-Oct-12 9:37
mveRichard MacCutchan30-Oct-12 9:37 
AnswerRe: Write a tiff file to disk Pin
CPallini31-Oct-12 0:03
mveCPallini31-Oct-12 0:03 

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.