This function releases all resources owned by the statistics API, including any open Gateway daemon connections.
An application can use this function as part of a normal shutdown. The function can also be used in the event of a severe error, for example where some form of controlled shutdown is required but references to gateway tokens have been lost.
Copied result sets are not be freed by this function, because the API does not own or maintain a record of copied result sets.