delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/05/08:39:24

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Subject: Re: [PATCH] setup.exe: removes some memory leaks from fromcwd.cc
From: Robert Collins <robert DOT collins AT itdomain DOT com DOT au>
To: Pavel Tsekov <ptsekov AT syntrex DOT com>
Cc: cygwin AT cygwin DOT com
In-Reply-To: <3BE68FC5.C7CDF863@syntrex.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>
X-Mailer: Evolution/0.15 (Preview Release)
Date: 06 Nov 2001 09:41:01 +1100
Message-Id: <1005000062.1663.8.camel@lifelesswks>
Mime-Version: 1.0
X-OriginalArrivalTime: 05 Nov 2001 13:46:40.0692 (UTC) FILETIME=[4C29B740:01C16600]

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019