From: Peter Hickman Date: 2002-07-04T00:12:14+09:00 Subject: Re: Ruby implementation Q's Paul Brannan wrote: >On Wed, Jul 03, 2002 at 11:17:44PM +0900, Peter Hickman wrote: > >>How about a class with the following interface. >> >>x = BitMapLoader.new(); >> >>x.loadbitmap("image.tga"); >>x.dosomethingwiththedata(); >>x.unloadbitmap(); >> > >What happens of dosomethingwiththedata() raises an exception? > >Paul > > Good question. If the program requires that dosomethingwiththedata() actually work then i think that the program would have to terminate and thereby free the resources. If however it was a more minor error that dosomethingwiththedata() could detect within itself before raising the exception then maybe it could deallocate the resources before raising the exception. Again this is just guesswork, someone with more knowledge of the C interface should come in here.