comp.lang.ada
 help / color / mirror / Atom feed
From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: Ensuring resource cleanup
Date: Mon, 08 Feb 2010 16:29:38 +0100
Date: 2010-02-08T16:29:38+01:00	[thread overview]
Message-ID: <9lapkh.88a.ln@hunter.axlog.fr> (raw)
In-Reply-To: <87zl3jertf.fsf@mid.deneb.enyo.de>

Florian Weimer a �crit :

>   declare
>      X : Object;
>   
>   begin
>      Init (X);
>      begin
>         Make_Use_Of (X);
>      exception
>         when others =>
>            Cleanup (X);
>            raise;
>      end;
>      Cleanup (X);
>   end;
> 
> But I'd really have a tool that ensures that Init and Cleanup calls
> are properly paired in this way.
> 
Such a tool exists, of course ;-). AdaControl rule Unsafe_Paired_Calls.

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



  reply	other threads:[~2010-02-08 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 14:16 Ensuring resource cleanup Florian Weimer
2010-02-08 15:29 ` Jean-Pierre Rosen [this message]
2010-02-08 15:31 ` Robert A Duff
2010-02-08 16:01   ` Florian Weimer
2010-02-08 16:18     ` Robert A Duff
2010-02-08 18:30       ` Florian Weimer
2010-02-08 20:47         ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox