add destroy to pvaClientChannel; in pvaClientGet channel is weak_pointer

This commit is contained in:
mrkraimer
2016-05-17 14:26:41 -04:00
parent cd9bdec84e
commit 40fb22ebd9
4 changed files with 61 additions and 18 deletions

View File

@@ -149,17 +149,27 @@ PvaClientChannel::~PvaClientChannel()
<< " this " << this << " channel " << channel
<< endl;
}
{
destroy();
}
void PvaClientChannel::destroy()
{
{
Lock xx(mutex);
if(isDestroyed) return;
isDestroyed = true;
}
if(PvaClient::getDebug()) {
cout << "PvaClientChannel::destroy() "
<< " channelName " << channelName
<< " this " << this << " channel " << channel
<< endl;
}
if(PvaClient::getDebug()) showCache();
if(channel) channel->destroy();
if(channel) channel.reset();
if(channel) channel.reset();
pvaClientGetCache.reset();
pvaClientPutCache.reset();
}