Preventing memory leaks in Delphi is extremely easy, much easier than with most other systems (those without garbage collection, of course). There are products which do all detection for you, without any of your help. It takes just one call to activate them.
I used to use MemChk, it worked flawlessly:
MemCheck home page[
^].
Presently I use Free Pascal, and highly recommend it, even if you use Delphi; Free Pascal is deeply cross-platform, with very interesting UI abstraction layer, which helps you to develop UI for very many platforms at the same time. It invokes similar memory leak finder automatically, just by checking one of the project options. Most likely, you can fetch its source code and use it for Deplhi as well. It's called
Heaptrc. It also works flawlessly. Please see:
heaptrc[
^],
leakview[
^].
The second link shows advanced usage; in most cases you need nothing of it. Usually, you don't need anything like that.
—SA