Re: [OB] Add cleanup, source.c

Joel Brobecker
2007-07-04T17:35:46Z

> What's going on here is that GDB uses one construct, cleanups, to
> implement two different useful behaviors, and does so in a perilous
> way.
> where 'cleanup_success' discards failure handlers and runs finally
> handlers. The 'error' function would call a companion to that named
> 'cleanup_on_failure', which runs both finally and failure handlers.

A very interesting analysis, Jim. I confess that up to today, I have
been using the two concepts interchangeably, so I'm pretty sure that
I have introduced the potential for memory leaks :-(.

> So. Only 270 calls to 'do_cleanups' and 47 calls to
> 'discard_cleanups' to examine.

Good luck. Let me know if you'd like some help, I feel partly responsible
for the mess. We can split the number of files that need to be inspected.

--
Joel