Internet Direct (Indy)
Home
PreviousUpNext
TIdThreadSafeList.ClearAndFree Method

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

Pascal
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

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.