From -6759950408836730299
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,2cda86d818184499
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-01-28 01:08:19 PST
Path: gmd.de!xlink.net!howland.reston.ans.net!noc.near.net!news.delphi.com!news.delphi.com!not-for-mail
From: bobkf@news.delphi.com (BOBKF@DELPHI.COM)
Newsgroups: comp.std.c++
Subject: Re: new Thing() failure in ctor
Date: 27 Jan 1994 03:05:29 -0500
Organization: Delphi Internet Services Corporation
Lines: 25
Message-ID: <2i7sk9$r4a@news.delphi.com>
References: <hopps.759599854@mmm.com>
NNTP-Posting-Host: news.delphi.com
Keywords: exception new delete

hopps@yellow.mmm.com (Kevin J Hopps) writes:

>I am issuing another plea to the committee to address what seems to me
>to be a major hole in the standard as it has evolved thus far.  If this
>has been addressed already, please forgive my plea, and update my on the
>decision.

>To reiterate:  consider the following statement.
>    Thing* tp = new Thing;
>Suppose that the memory for Thing is allocated but the constructor for
>Thing throws an exception.  How is the memory for Thing reclaimed?

>Please give us ammunition for battle with our compiler providers.
>My current implementation has a memory leak, which gets serious if
>sizeof(Thing) is large.

I would like to add my voice to the plea. The ARM and/or September draft
standard do not require that memory allocated by new is freed when a
constructor fails. It seems to be left up to the good intentions of the
compiler writer.

It can't be that only people in Minnesota see this as a problem.

Bob Foster
objfactory@aol.com


