🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2194

Re: object contruction/destruction in c++, design flaw?

#2194
From: J. Kanze
Date: Sat, 14 Oct 1995 15:57
28 lines
1614 bytes
James M. Curran (72261.655@CompuServe.COM) wrote:
|> |>    a::a()
|> |>    {
|> |>        mBuffer1 = new char[ 1000 ] ;
|> |>        try
|> |>        {
|> |>            mBuffer2 = new char[ 1000 ] ;
|> |>        }
|> |>        catch (...)
|> |>        {
|> |>            delete mBuffer2 ;
|> |>        }
|> |>    }

|> That last bit should be "delete mBuffer1;", shouldn't it?  Or am 
|> I missing something?

You're right.  Just a typo.  (Also: it should be delete[], and not just
delete.  Some days your better off staying bed.)
-- 
James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle--
                             --Beratung in industrieller Datenverarbeitung

[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <45o1ns$nve@gabi.gabi-soft.fr>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <44odn6$c61@gabi.gabi-soft.fr> <45jmri$cj6$1@mhafm.production.compuserve.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: kanze@gabi-soft.fr (J. Kanze)
Newsgroups: comp.std.c++
Subject: Re: object contruction/destruction in c++, design flaw?
Date: 14 Oct 1995 15:57:41 GMT
Organization: GABI Software, Sarl.
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <45o1ns$nve@gabi.gabi-soft.fr>
References: <44odn6$c61@gabi.gabi-soft.fr> <45jmri$cj6$1@mhafm.production.compuserve.com>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Newsreader: TIN [version 1.2 PL2]
Content-Length: 800
Originator: clamage@taumet