nanogui: XCreateWindow/XDestroyWindow memory leak?


Previous by date: 13 Nov 2007 17:14:51 +0000 Re: How can I connect a usb mouse to nano-X if I have already programmed ADS7846MOUSE? - PATCH for this!, Wein, Peter (ext)
Next by date: 13 Nov 2007 17:14:51 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr
Previous in thread: 13 Nov 2007 17:14:51 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr
Next in thread: 13 Nov 2007 17:14:51 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr

Subject: RE: [nanogui] XCreateWindow/XDestroyWindow memory leak?
From: "Martin Kajdas" ####@####.####
Date: 13 Nov 2007 17:14:51 +0000
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC24F993A@mkmail.MKPROD.COM>

> Hmmm.  The only auxillary structures around a Window type in NXLIB
have to do with window properties, see ChProperty.c.  
> However, these are properly deallocated, and only used if
XChangeProperty is used (please check).

Well, there is a bug in ChProperty.c and _nxDelAllProperty() never
deletes anything.
The problem is that _nxDelAllProperty() checks if (win->w == w) but
win->w is never set.
To fix this you have to add:
      win->w = w;
in _nxAddProperty(), line 47, right before:
      if (!win->properties)

After this fix, the _nxDelAllProperty() deletes properties like it is
suppose to.
This reduced the amount of memory not deallocated by windows but there
is still something not being deallocated.

I have a question:
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.
But then I do not know much about it.
Martin

Previous by date: 13 Nov 2007 17:14:51 +0000 Re: How can I connect a usb mouse to nano-X if I have already programmed ADS7846MOUSE? - PATCH for this!, Wein, Peter (ext)
Next by date: 13 Nov 2007 17:14:51 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr
Previous in thread: 13 Nov 2007 17:14:51 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr
Next in thread: 13 Nov 2007 17:14:51 +0000 Re: XCreateWindow/XDestroyWindow memory leak?, Greg Haerr


Powered by ezmlm-browse 0.20.