RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
VarUtils.SafeArrayDestroy Function

Destroys a safe array.

Pascal
function SafeArrayDestroy(VarArray: PVarArray): HRESULT; stdcall;
C++
__stdcall HRESULT SafeArrayDestroy(PVarArray VarArray);

Use SafeArrayDestroy to destroy safe array given through VarArray.  

SafeArrayDestroy first checks whether the given safe array is locked or nil. If this is the case, then SafeArrayDestroy returns VAR_ARRAYISLOCKED or VAR_INVALIDARG, correspondingly.  

If the safe array is valid, then SafeArrayDestroy removes the actual data from memory using a call to SafeArrayDestroyData and also destroys the associated safe array descriptor with a call to SafeArrayDestroyDescriptor. If SafeArrayDestroy manages to destroy the safe array, it returns a VAR_OK result. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!