destruction of shared provider

This commit is contained in:
Matej Sekoranja
2016-03-10 10:26:33 +01:00
parent f0417995d0
commit d139c42d17
2 changed files with 35 additions and 21 deletions
+12
View File
@@ -24,6 +24,18 @@ class ChannelProviderFactoryImpl : public ChannelProviderFactory
public:
POINTER_DEFINITIONS(ChannelProviderFactoryImpl);
virtual ~ChannelProviderFactoryImpl()
{
Lock guard(cfact_mutex);
if (cfact_shared_provider)
{
ChannelProvider::shared_pointer provider;
cfact_shared_provider.swap(provider);
// factroy cleans up also shared provider
provider->destroy();
}
}
virtual std::string getFactoryName()
{
return ClientContextImpl::PROVIDER_NAME;