Internet Direct (Indy)
Home
PreviousUpNext
TIdStack.DecUsage Method

Maintains the internal usage counter for the global protocol stack in the Indy library.

Pascal
class procedure DecUsage;

DecUsage is a class procedure used to maintain a counter for the number of times the stack instance has be accessed for Indy components. 

DecUsage can raise an EAssertionFailed exception if the critical section used to protect access to resources for the protocol stack in GStackCriticalSection has not been assigned a valid value. 

DecUsage calls the Acquire method for the critical section and attempts to decrease the value in the GInstanceCount variable. When the usage counter in GInstanceCount reaches Zero (0), the global stack instance in GStack if freed. 

The Release method for the critical section is called when the operation is completed, or an exception occurs in accessing the resources protected by the critical section. 

IncUsage is used to increment the global usage counter. 

Please note that applications do not normally call the IncUsage and DecUsage methods for the global stack instance; these method are called when TIdComponent or TIdBuffer instances are created, or when design-time property editors are created in the .Net environment.

Exceptions 
Description 
EAssertionFailed 
Raised when the critical section used to protect access to resources for the protocol stack in GStackCriticalSection has not been assigned. 
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.