[linrad] Re: Memory leakage.

2006-04-19 Thread Richard Hosking
Leif I cant speak as an accomplished programmer, having only done simple projects in C++ Still the code seems to be part of a routine. It looks like cross_cursor is an object of class XCreateFontCursor Maybe this is not being destroyed after use? I havent the faintest how you would find the

[linrad] Re: Memory leakage

2006-04-19 Thread Joe Fitzgerald
Leif Asbrink wrote: If I can assume that lost memory is reclaimed by the os at program exit or at some suitable time afterwords (daily?) I can just forget the whole issue:-) A few KB at program strart or mode change is not a big problem. If you are growing by 1KB per minute or something

[linrad] Re: Memory leakage.

2006-04-19 Thread Joseph B. Fitzgerald
There is (usually) a destructor Richard, Please note that X, like most Unix software that has been around for any length of time, is written in C, not C++. Consequently, one often has to explicitly call some sort of close() function to clean up resources rather than relying on a destructor.

[linrad] Re: Memory leakage

2006-04-18 Thread Joseph B. Fitzgerald
What is the meaning of lost memory ? Is it a part of memory space that will eventually be swapped to disk? Presumably there is no owner to it, will it just accumulate until the next reboot ? In valgrind's terminology, lost memory is synonymous with a memory leak - memory which has been malloc'ed

[linrad] Re: Memory leakage.

2006-04-18 Thread Robert McGwier
Leif writes the code C and assembly so for Leif this means if he does a malloc, calloc, realloc, etc. and if he then no longer needs the memory, he must do a free on the no longer used memory. Bob Richard Hosking wrote: Lost memory is allocated when an object in C++ is created , but not

[linrad] Re: Memory leakage.

2006-04-18 Thread Dan Hammill
mailinglist [mailto:[EMAIL PROTECTED] On Behalf Of Robert McGwier Sent: Tuesday, April 18, 2006 5:46 PM To: Linrad mailinglist Subject: [linrad] Re: Memory leakage. Leif writes the code C and assembly so for Leif this means if he does a malloc, calloc, realloc, etc. and if he then no longer needs the memory