Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Mon, 5 Nov 2001 11:50:03 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: [PATCH] setup.exe: removes some memory leaks from fromcwd.cc Message-ID: <20011105115003.A19389@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <3BE2CC48 DOT 47462EC6 AT syntrex DOT com> <1004743324 DOT 9086 DOT 39 DOT camel AT lifelesswks> <3BE6642E DOT 9AA62568 AT syntrex DOT com> <1004997932 DOT 1663 DOT 2 DOT camel AT lifelesswks> <3BE68FC5 DOT C7CDF863 AT syntrex DOT com> <1005000062 DOT 1663 DOT 8 DOT camel AT lifelesswks> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1005000062.1663.8.camel@lifelesswks> User-Agent: Mutt/1.3.21i On Tue, Nov 06, 2001 at 09:41:01AM +1100, Robert Collins wrote: >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'. Since the memory is going to be freed on exit anyway, I don't see any reason to go to great lengths to invent a system for freeing it. setup.exe is a short-lived program. We should be good about freeing up memory that we use because that's good programming but I don't think we have to invent some kind of garbage collection system to deal with this. cgf -- 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/