Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

SafeArrayDestroy Function

Destroys an existing array descriptor and all of the data in the array. If objects are stored in the array, Release is called on each object in the array.

HRESULT SafeArrayDestroy(  
  SAFEARRAY   *psa  


Pointer to an array descriptor created by SafeArrayCreate.

The return value obtained from the returned HRESULT is one of the following.

Return value





The array is currently locked.


The item pointed to by psa is not a safe array descriptor.

Safe arrays of variant will have VariantClear Function called on each member and safe arrays of BSTR will have SysFreeString Function called on each element. IRecordInfo::RecordClear Function will be called to release object references and other values of a record without deallocating the record.

STDMETHODIMP_(ULONG) CEnumPoint::Release()
   if(--m_refs == 0){
      if(m_psa != NULL)
      delete this;
      return 0;
   return m_refs;
© 2015 Microsoft