DelphiFAQ Home Search:
General :: Programming :: Delphi :: VCL
About the Delphi VCL (Visual Component Library)


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

Freeing a TList

If there is any possibility of the freeing code being called re-entrantly, make sure to store a nil in the list before freeing the object; your code should look like this:

// original from Ray Lischner
 for i := 0 to List.Count-1 do
   TempNode := List[i];
   List[i] := nil;

Otherwise, the list would contain an invalid pointer. Even if you are not using multi-threading, Delphi has a few places where it is re-entrant.

Generated 16:01:22 on Sep 24, 2020