changes suggested by Michael Davidsaver

This commit is contained in:
mrkraimer
2017-06-04 14:52:53 -04:00
parent acd9ab42cc
commit b37baf8ecb
7 changed files with 15 additions and 47 deletions
+4 -4
View File
@@ -66,8 +66,8 @@ public:
static Mutex startStopMutex;
ChannelProviderRegistryPtr ClientFactory::channelRegistry = ChannelProviderRegistryPtr();
ChannelProviderFactoryImplPtr ClientFactory::channelProvider = ChannelProviderFactoryImplPtr();
ChannelProviderRegistryPtr ClientFactory::channelRegistry;
ChannelProviderFactoryPtr ClientFactory::channelProvider;
int ClientFactory::numStart = 0;
void ClientFactory::start()
@@ -81,7 +81,7 @@ std::cout << "ClientFactory::start() numStart " << numStart << std::endl;
channelProvider.reset(new ChannelProviderFactoryImpl());
channelRegistry = ChannelProviderRegistry::getChannelProviderRegistry();
std::cout << "channelRegistry::use_count " << channelRegistry.use_count() << std::endl;
channelRegistry->registerChannelProviderFactory(channelProvider);
channelRegistry->add(channelProvider);
}
void ClientFactory::stop()
@@ -95,7 +95,7 @@ std::cout << "channelRegistry::use_count " << channelRegistry.use_count() << std
if (channelProvider)
{
channelRegistry->unregisterChannelProviderFactory(channelProvider);
channelRegistry->remove(ClientContextImpl::PROVIDER_NAME);
if(!channelProvider.unique()) {
LOG(logLevelWarn, "ClientFactory::stop() finds shared client context with %u remaining users",
(unsigned)channelProvider.use_count());
+3 -3
View File
@@ -17,13 +17,13 @@ namespace pvAccess {
class ChannelProviderRegistry;
typedef std::tr1::shared_ptr<ChannelProviderRegistry> ChannelProviderRegistryPtr;
class ChannelProviderFactoryImpl;
typedef std::tr1::shared_ptr<ChannelProviderFactoryImpl> ChannelProviderFactoryImplPtr;
class ChannelProviderFactory;
typedef std::tr1::shared_ptr<ChannelProviderFactory> ChannelProviderFactoryPtr;
class epicsShareClass ClientFactory {
private:
static ChannelProviderRegistryPtr channelRegistry;
static ChannelProviderFactoryImplPtr channelProvider;
static ChannelProviderFactoryPtr channelProvider;
static int numStart;
public:
static void start();