Re: [gtk-list] Bug in gdkwindow.c?



On Thu, 17 Sep 1998, Andreas Tille wrote:

> Hello,
> 
> I'm using GTK+ 1.0.4 from Debian Hamm 2.0.
> I'm not familiar with internals of GTK and don't have the time to
> check out how to handle the CVS repository.  But I think I've
> found a bug and hope someone can forward it to the right place.
> 
> I tried to debug a selfmade program using gdb and dmalloc.  My program
> stoped (only in this debugging suite not normally!!) in 
>     gdkwindow.c: gdk_window_foreign_new ()
> after line
>   XQueryTree (gdk_display, anid, &root, &parent, &children, &nchildren);
>   XFree (children);
> Obviously it is possible, that XQueryTree() returns children == NULL
> (I havn't any idea what XFree is good for ...) and XFree trys to
> free a NULL-pointer.  In my opinion there should be a
> 
>   if (children) XFree(children);
> 
> to avoid this error.  In my opinion it is important also if the
> program normally don't stop at this place.

you're perfectly correct about your guess, this has been fixed in the
1.1 tree already though.

> Moreover dmalloc reports lots of not freed memory (not from my own
> code).  Are thgere any investigations to correct this?

we usually try to plug all memory leaks that we encounter, however sometimes
something slips through. there's also a bunch of memory that gtk will keep
allocated forever, so it's not always that easy to determine whether some
specific allocation leaks or not.
some developers do run efence or similar memory debuggers on gtk occasionally,
so chance is not too bad that most leaks are going to be plugged in some newer
versions.

> 
> Kind regards
> 
>         Andreas.
> 

---
ciaoTJ



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