bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] Hint window memory problem


From: Joern Thyssen
Subject: Re: [Bug-gnubg] Hint window memory problem
Date: Mon, 29 Jul 2002 10:33:29 +0000
User-agent: Mutt/1.2.5.1i

On Mon, Jul 29, 2002 at 11:50:32AM +0200, Jim Segrave wrote
> 
> Enclosed is a detailed gdb investigation of how gtk is handling the
> user data associated with the Hint window. The quick summary is that
> when you close the Hint window, gtk is freeing the hintdata before
> calling DestroyHint(), which needs to find a pointer to a matchlist in
> the user data so that it can free this. Under FreeBSD, this can cause
> severe problems (putting a test for a null pointer in the matchlist
> helps prevent core dumps, but that's only by luck.
> 
> Under other OSes, I expect that this can also cause problems, it just
> may take longer before someone gets hit by this, depending on how the
> malloc/free system works, when it garbage collects, etc.

Is it still a problem with my check-in from saturday?

In this version the hintdata is freed when the actual list of moves is
destroyed.  However, the "movelist *pml" and "move *amMoves" are not
freed. 

The caller (either from the annotation window or the hint window) must
free pml and pml->amMoves itself. So the current version of DestroyHint
only frees pml and pml->amMoves.

Hmmm, in fact, gtkchequer.c forgets to free the hintdata. I should fix
that, otherwise we have a memory leak.

Jørn



-- 
Joern Thyssen, PhD
Vendsysselgade 3, 3., DK-9000 Aalborg, Denmark
+45 9813 2791 (private) / +45 2077 2689 (mobile) / +45 9633 7036 (work)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]