Re: Avoid Memory Leakage



I hate and detest memory leaks. This is the main reason why I moved away from microsoft system computers. They are notorious for memory leaks and causing your system to crash, in fact this is probably one of the main reasons why there computers crash so much. They must write very bad software. There should be an entire class or discussion on how to develop quality software without memory leak.


Sincerely
"use the memory or lose the memory"

On Tuesday, Dec 2, 2003, at 23:02 America/Phoenix, Christoph Kappel wrote:

On Tue, 02 Dec 2003 19:06:44 -0700
Michael Torrie <torriem chem byu edu> wrote:

I've been using GString extensively in a non-gui project of mine and
have absolutely no leakage whatsoever.  That's even running the main
loop over and over millions of times.  I'm almost certain there's a
problem with your program.  For example, when you destroy a string,
you have to tell it to destroy the memory allocated to the character
array. I've been using GString in conjunction with GSList's and have
no problems whatsoever.  In fact it has worked so well that I think
the utility functions in glib should be considered standard c library
functions.

I will try to make a text case later, guess the leak occurs only in
conjunction with the GIOChannels. I don't use any GStrings in my
project, except the GString buffer from the GIOChannels. Closing the
channel und flushing the buffer should be enough to free all
allocated memory, isn't it?

Actually i tried GStrings in a standalone test and i it worked without
any leakage.

Christoph

--
Every feature is a bug, unless it can be disabled.

GnuPG Public Key http://prime.zapto.org/~unexist/unexist.asc
<mime-attachment>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]