Here is a snippet of our C++ code...
std::shared_ptr<grpc::ChannelCredentials> m_pChanCreds;
std::shared_ptr<grpc::ChannelCredentials> m_pCreds;
std::shared_ptr<grpc::CallCredentials> m_pCallCreds;
std::unique_ptr<Speech::Stub> m_pSpeechStub;
m_pChanCreds = grpc::SslCredentials(grpc::SslCredentialsOptions());
m_pCallCreds = grpc::ServiceAccountJWTAccessCredentials(key, 3600);
m_pCreds = grpc::CompositeChannelCredentials(m_pChanCreds, m_pCallCreds);
auto channel = grpc::CreateChannel(m_strResourceURI, m_pCreds);
m_pSpeechStub = Speech::NewStub(channel);
To clean up m_pCallCreds, m_pCreds, channel and m_pSpeechStub, is it sufficient to just set m_pSpeechStub to NULL?
How long does it take for the channel to be terminated after the stub is set to NULL? Is there anything else we could/should do to terminate and tear down the channel?
What about the credentials? Anything we need to do to destroy them?
Thanks.