Some of the values returned by functions in the OLE Automation API are actually allocated by the Win32 libraries, and thus use memory that will not be reclaimed automatically by the Dylan garbage collector.
If a property value or dispatch method result is a string, it will be represented as an instance of class <BSTR> ("BASIC string"), which is a subclass of <string> (but not a <byte-string>). This string value will be allocated by Win32. Similarly, sequences or arrays received as dispatch method results or property values will be instances of <ole-array> or <ole-vector>, again allocated by Win32.
To ensure that the memory occupied by such a value is recycled, you must call the function destroy on the string when it is no longer in use.
Also, if an interface (such as an instance of <class-factory> or <LPDISPATCH>) is received as a dispatch method result or property value, you must call Release on it when finished using it.