Subject: Re: [PATCH] setup.exe: removes some memory leaks from fromcwd.cc
From: Robert Collins <[email-masked]>
To: Pavel Tsekov <[email-masked]>
Cc: [email-masked]
Date: 06 Nov 2001 09:41:01 +1100

On Tue, 2001-11-06 at 00:10, Pavel Tsekov wrote:
> Robert Collins wrote:
> > Unfortunately it's tied up with my streams work, so rather than
> > committing with that in-progress (I haven't got one-of-each done yet)
> > I'm going to send in a patch, which you can play with. The point of this
> > is that a lot of the more mundane things you might notice should have
> > been cleaned up in advance by this.
> 
> Sounds ok with me :) Btw what do you think of registering an
> atexit() handler in setup so dynamically allocated global variables 
> can be freed there ? This is the way I started doing the cleanup
> routine at my snapshot at home. Any drawback with this approach ?

I'm not sure that atexit handlers are called from ExitProcess.

I'm really not worried about cleaning up globals at exit - I'm much more
warried about cleaning up globals as we go, or as we change from dialog
to dialog. Exit is a trapdoor, so it cannot be a 'problem'.

Other than the issue about being called, atexit sounds fine to me. It
also allows federation of that code to the local area it relates to
which is good.

IMO the big issue is reducing the number of globals more than anything.
A lot of the classes aren't really that *cough* classy :}.

Rob

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/