Location: Symbol Reference > Classes > TJwWTSSessionList Class > TJwWTSSessionList.Destroy Destructor
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
TJwWTSSessionList.Destroy Destructor
Pascal
destructor Destroy; reintroduce;

The Destroy destructor destroys the @Classname instance. Note that it is not necessary to manually free a @Classname as it will be freed when the TJwTerminalServer instance that owns the @Classname (Owner property) is freed.

If you free a @Classname be sure to also set it to nil to prevent the Owner to free it as well (which would produce an Access Violation). 

Borland's WaitFor procedure contains a bug when using Waitfor in combination with FreeOnTerminate := True; During the loop in WaitFor the TThread object can be freed and its Handle invalidated. When MsgWaitForMultipleObjects() is called again, it fails, and then a call to CheckThreadError() afterwards throws on EOSError exception with an error code of 6 and an error message of "the handle is invalid". http://qc.borland.com/wc/qcmain.aspx?d=6080 Therefore we override the WaitFor function and Create an Exception function TJwWTSEnumServersThread.WaitFor: LongWord; begin // Return error //Result := ERROR_NOT_SUPPORTED; 

raise EJwsclUnimplemented.CreateFmtWinCall(RsWinCallFailed, 'WaitFor function is not supported, please use Wait instead', ClassName, RsUNTerminalServer, 1203, False, 'WaitFor function is not supported, please use Wait instead', ['TJwWTSEnumServersThread.WaitFor']); end;

Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!