llewelly said:
These views are not contradictatory. You do have a memory leak, but
most evironments will clean up remaining memory leaks (in some
sense) when a process exits, but I have used a few which did
not. Your environment's behavior may make this memory leak
unimportant. Sometimes you will find yourself extending a program
in a way that makes a previously non-important memory leak
important. Sometimes you will find it is significantly cheaper to
let the environment clean up after you. The safe bet is to
prevent all resource leaks yourself, and not rely on the
environment to clean them up - unless performance (or development)
needs dictate otherwise.
Please note the C++ standard says nothing about any of this; either
kind of environment can host a fully conforming C++
implementation.
Thanks for the very complete explaination...it helps a lot.
I think I have used DOS and windows95 IDEs where this was a problem iff
the program was launched from the IDE. I do not think it is a
common problem.
Thanks for the tip
In any case, memory is not the only resource, and new / malloc are
not the only ways to acquire memory (though the other ways are
outside C++). Maybe your OS gives fewer cleanup guarantees for
other resources.
For the boxen I have around the house, ' periodic reboot ' is about
once every 3-6 months, and typically caused by a need to move the
machine beyond its cordage, or install new hardware. So I'm not
sure why you need to reboot.
I was actually kinda joking about the reboot biz, as the thread had
already gotten a little OT. My win xp machine almost never crashes,
although I do turn it off most nights. However, applications, eg my
compiler crashes pretty regularly...no fault of the OS. I do like NT
(oops...i mean xp) compared to 3.11, 95, 98 that I used before. NT 4
was good too...I haven't really had stability problems since win 95
(before the service release)...
Anyway...thanks again. My take-home message is that if ctrl-breaking
out of progs I'm writing, perhaps it's better to access the console
from *outside* the IDE interface, as doing so from within may
(shall??) cause a memory leak...and subsequent crash (bloodshed indeed
*did* crash on me twice today while working with progs that had circa
11 MB in memory...and I was breaking out of them from the IDE!!) That
was why I posted in the first place.
Thanks guys...I think I understand this issue...now for multiple
inheritance...maybe next week.