nanogui: XCreateWindow/XDestroyWindow memory leak?


Previous by date: 13 Nov 2007 20:34:15 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next by date: 13 Nov 2007 20:34:15 +0000 Re: Arc drawing not working, Martin Kajdas
Previous in thread: 13 Nov 2007 20:34:15 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next in thread: 13 Nov 2007 20:34:15 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Hermann Ulrichskoetter

Subject: Re: [nanogui] XCreateWindow/XDestroyWindow memory leak?
From: "Greg Haerr" ####@####.####
Date: 13 Nov 2007 20:34:15 +0000
Message-Id: <06fe01c82634$87a8a330$0300a8c0@RDP>

> The problem is that _nxDelAllProperty() checks if (win->w == w) but
win->w is never set.

Good catch!  I'll add this to CVS.


> This reduced the amount of memory not deallocated by windows but there
is still something not being deallocated.

Put a printf() in the other XSetClip function to see whether
this might be the other leak, or whether we should still look
hard at ChProperties.c


> I can see that FLTK sends some properties with property name = NULL.
Is this legal and will it cause any problems in nxlib?
My thinking is that if the NULL properties represent different
properties, then nxlib will not recognize them as being different.

The basic idea behind properties is to allow a list of
associations of names and values attached and accessible
from a Window.  The property name is converted
to an Atom by using XInternAtom which takes a string
name and returns an integer Atom.  This Atom is then used
as the name to XChangeProperty, with byte data passed
for the value.

Thus, if the Atom name itself is 0 (NULL), passed to 
XChangeProperty, then this likely should be checked
for first, and do nothing.  If that's not what you're
saying with property name=NULL above, then
please explain.

So, we may also be associating some NULL properties
with data, but these should have been deleted when
the _nxDelProperty is called.

Another fix is that we should check for data=NULL
and handle that accordingly in the _nxAddProperty
code.

Regards,

Greg


Previous by date: 13 Nov 2007 20:34:15 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next by date: 13 Nov 2007 20:34:15 +0000 Re: Arc drawing not working, Martin Kajdas
Previous in thread: 13 Nov 2007 20:34:15 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Martin Kajdas
Next in thread: 13 Nov 2007 20:34:15 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Hermann Ulrichskoetter


Powered by ezmlm-browse 0.20.