Click here to Skip to main content
16,004,969 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 20:43
devvvy14-Aug-07 20:43 
GeneralRe: destructor - string, multimap, ifstream Pin
Maxwell Chen14-Aug-07 21:04
Maxwell Chen14-Aug-07 21:04 
GeneralRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 21:10
Stephen Hewitt14-Aug-07 21:10 
AnswerRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 20:04
Stephen Hewitt14-Aug-07 20:04 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 21:49
devvvy14-Aug-07 21:49 
GeneralRe: destructor - string, multimap, ifstream Pin
Stephen Hewitt14-Aug-07 21:51
Stephen Hewitt14-Aug-07 21:51 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 23:01
devvvy14-Aug-07 23:01 
GeneralRe: destructor - string, multimap, ifstream Pin
jhwurmbach14-Aug-07 23:23
jhwurmbach14-Aug-07 23:23 
devvvy wrote:
Now:
CSomeClass::~CSomeClass()
{
m_oApplicationConfig.clear();

return;
}


In this case, you can safely omit the call to clear(): It is done automagically by the multimap-destructor. That idiom is called RAII: "Resource aquisition is initialisation".

Something other smells fishy in your program, and it is not in this class definition.
Do you somewhere have a pointer to a CSomeClass, and delete this twice?



Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
George Orwell, "Keep the Aspidistra Flying", Opening words

GeneralRe: destructor - string, multimap, ifstream Pin
devvvy14-Aug-07 23:32
devvvy14-Aug-07 23:32 
GeneralRe: destructor - string, multimap, ifstream Pin
jhwurmbach14-Aug-07 23:35
jhwurmbach14-Aug-07 23:35 
GeneralRe: destructor - string, multimap, ifstream Pin
devvvy15-Aug-07 0:36
devvvy15-Aug-07 0:36 
GeneralRe: destructor - string, multimap, ifstream Pin
jhwurmbach15-Aug-07 1:22
jhwurmbach15-Aug-07 1:22 
Generalhow can I enable "Full-page heap" from Global Flags? Pin
devvvy15-Aug-07 17:43
devvvy15-Aug-07 17:43 
QuestionRe: destructor - string, multimap, ifstream Pin
David Crow15-Aug-07 3:17
David Crow15-Aug-07 3:17 
AnswerRe: destructor - string, multimap, ifstream Pin
devvvy15-Aug-07 13:49
devvvy15-Aug-07 13:49 
Questiona simple question for serialization Pin
asdertim14-Aug-07 12:33
asdertim14-Aug-07 12:33 
AnswerRe: a simple question for serialization Pin
Mark Salsbery14-Aug-07 14:51
Mark Salsbery14-Aug-07 14:51 
GeneralRe: a simple question for serialization Pin
asdertim14-Aug-07 18:42
asdertim14-Aug-07 18:42 
QuestionRe: a simple question for serialization Pin
Mark Salsbery14-Aug-07 19:05
Mark Salsbery14-Aug-07 19:05 
AnswerRe: a simple question for serialization Pin
asdertim14-Aug-07 19:20
asdertim14-Aug-07 19:20 
GeneralRe: a simple question for serialization Pin
Nelek20-Aug-07 20:02
protectorNelek20-Aug-07 20:02 
QuestionVC++ execution slow down in windows 2003 Pin
penewman14-Aug-07 12:00
penewman14-Aug-07 12:00 
AnswerRe: VC++ execution slow down in windows 2003 Pin
Maxwell Chen14-Aug-07 17:15
Maxwell Chen14-Aug-07 17:15 
Questioncalling c++ function from c. Pin
yoti1114-Aug-07 8:59
yoti1114-Aug-07 8:59 
AnswerRe: calling c++ function from c. Pin
Maxwell Chen14-Aug-07 9:03
Maxwell Chen14-Aug-07 9: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.