[This is preliminary documentation and subject to change.]
Walks a command tree and deallocates all DBCOMMANDTREE node structures as well as all variants in those structures, and finally sets the root pointer to a null pointer.
HRESULT FreeCommandTree(
DBCOMMANDTREE ** ppRoot
);
FreeCommandTree can be used by a consumer to free their copy of the command tree constructed locally or obtained by GetCommandTree. It does not free the copy of the tree owned by the command object. When a consumer calls SetCommandTree with fCopy = FALSE, the consumer relinquishes ownership of the memory to the provider. Therefore, if the consumer calls FreeCommandTree after having called SetCommandTree with fCopy = FALSE, FreeCommandTree returns an error code DB_E_CANNOTFREE meaning the consumer does not have ownership of the tree to free it.