On 13 July 2015 at 22:49, Dirk Hohndel <d...@hohndel.org> wrote: > On Mon, Jul 13, 2015 at 10:40:53PM +1000, Rick Walsh wrote: > > We only use three levels of taxonomy, but we were attempting to free > memory > > for seven. This led to some fun invalid point crashes. > > > > Please check I'm not way off the mark, but it definitely appears to fix > the > > crashes I was getting. > > I'm surprised this fixes your crashes. > We actually store as many levels as we get back from the service - we just > SHOW only three levels. And the other pointers SHOULD be NULL and > therefore freeing them should be no problem. > > So I think your patch is wrong in that it will leak memory.
I hoped the cause was as simple as I thought, but a leaky fix to hide a problem isn't all that helpful. > But since we > are already tracking how many entries we have, we might as well use that > to limit how many pointers we free. I'll make a similar commit in a moment > and would like you to test if that fixes your problem as well. > > Thanks for working on tracking this down. > > I just tried the latest master, including your fix. I have bridge foundations to design so haven't taken the time to understand how it works, and how that differs from before, but I can say that it appears to have fixed the problem. I.e. I can use the up/down arrows to scroll through my entire dive list, whereas previously it would semi-reliably crash after ~20 dives. Thanks, Rick
_______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface