5
votes
Vote UpVote

Try-Finally Blocks for Protecting Multiple Resources in Delphi

Marco's Tech Blog – The Delphi language shares with many others a standard resource allocation pattern to make sure that in case of an exception the resources is properly released. Resources in this context are memory objects, files, operating system objects and handles, and the like. In Delphi, compared to other languages with a garbage collector, the relevance increased by memory management considerations. Protecting a Single Object In the most simple cases, you'd write code like: allocate resource try use resource finally free resource end; A more specific example would be like: A1 := ...
Favorite? Off-Topic? marcocantu @ 2018-01-26 17:52

Statistics

Visits: 548
Votes: 5
Favorites: 1
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Jacek Krawczyk
Jiri Vrazdil
Yogi Yang
zdzichs
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)