Topic Path: Symbol Reference > Classes > TIdThreadSafeList Class > TIdThreadSafeList Methods > ClearAndFree Method
ContentsIndexHome
PreviousUpNext
TIdThreadSafeList.ClearAndFree Method

Removes and frees object instances in the thread-safe list.

procedure ClearAndFree;

ClearAndFree is a method used to force object instances stored in the thread-safe data type to freed and released. 

ClearAndFree calls LockList to enable resource protection for the thread-safe data type, and to gain access to the TIdList instance used in the Value property. 

ClearAndFree iterates over the contents of the TIdList instance, and calls the Free method for each TObject instance in the list. ClearAndFree calls the Clear method to ensure that the nil'd object references are removed from the list. 

ClearAndFree calls UnlockList to disengage resource protection for the thread-safe data type prior to exiting from the method. 

Use AddObject to store object instances in the thread-safe data type.

AddObject 

LockList 

UnlockList 

Clear

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.