nanogui: XCreateWindow/XDestroyWindow memory leak?


Previous by date: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next by date: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr
Previous in thread: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next in thread: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr

Subject: Re: [nanogui] XCreateWindow/XDestroyWindow memory leak?
From: "Greg Haerr" ####@####.####
Date: 16 Nov 2007 05:00:14 +0000
Message-Id: <07b401c8280d$89c0f7f0$6401a8c0@winXP>

> The problem is with _nxAddProperty function in the way is creates linked
lists of windows and properties.

I dug into this and found the [multiple] problems.  Basically,
the code needed your patch below, with the addition of clearing
out the window_list[hash] when the last window property was
removed, the old value stayed and caused problems.  I ended
up rewriting a major portion of it, as additional problems were 
found:

o Atoms less than XA_LAST_PREDEFINED are predefined,
and shouldn't be generated internally.

o XGetProperty wasn't implemented

Everything is now fixed and checked into CVS.  The files
Atom.c, ChProperty.c, and WindowProperty.c were modified.


> Also, using XGetAtomName inside printf causes another leak because the
return string is allocated (strdup) on heap and never released.

No, this is correct behaviour per the Xlib documentation.  FLTK
isn't releasing it and should be.

Regards,

Greg


Previous by date: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next by date: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr
Previous in thread: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next in thread: 16 Nov 2007 05:00:14 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr


Powered by ezmlm-browse 0.20.