12
SafeArrayDestroy uses the Safe Array attributes to perform memory release operations. If the array attributes are not properly set SafeArrayDestroy may not be able to release the memory used by the array elements. For example, if you have defined a Safe Array of BStrings but did not set the BString attribute flag of the Safe Array, then SafeArrayDestroy will not call StrFree to release the memory of the BString elements. This will obviously result in a memory leak. To set or read the attributes of a Safe Array, see the section entitled Setting and Reading Safe Array Features later in this manual.