6
votes
Vote UpVote

Creating multiple objects using try-finally

Olaf Monien – One of the most used object-oriented patterns is probably this one: foo := TFoo.create; try //do something with foo finally foo.free; end; It basically means, that if you create an instance of some class and if there is no “owner” who takes care of the new instance’s life cycle, then it is your responsibility to destroy the instance again, as soon as you are done with it. If you don’t care about freeing the objects you created, then you will get “memory leaks”, i.e. you app will use (possibly a lot) more memory as it should. The technique above is ...
Favorite? Off-Topic? Olaf Monien @ 2010-07-06 16:37

Statistics

Visits: 1310
Votes: 6
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

AlinS
jamiei
JC Chu
Jeroen Pluimers
Sergio
vcldeveloper
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)