make pvRequest weak_pointer for get, put, and monitor
This commit is contained in:
@@ -672,7 +672,7 @@ CAChannelGet::CAChannelGet(CAChannel::shared_pointer const & channel,
|
||||
:
|
||||
channel(channel),
|
||||
channelGetRequester(channelGetRequester),
|
||||
pvRequest(pvRequest)
|
||||
pvRequestWeak(pvRequest)
|
||||
{
|
||||
if(DEBUG_LEVEL>0) {
|
||||
cout << "CAChannelGet::CAChannelGet() " << channel->getChannelName() << endl;
|
||||
@@ -693,6 +693,8 @@ void CAChannelGet::activate()
|
||||
}
|
||||
ChannelGetRequester::shared_pointer getRequester(channelGetRequester.lock());
|
||||
if(!getRequester) return;
|
||||
PVStructurePtr pvRequest(pvRequestWeak.lock());
|
||||
if(!pvRequest) return;
|
||||
if(pvStructure) throw std::runtime_error("CAChannelGet::activate() was called twice");
|
||||
getType = getDBRType(pvRequest, channel->getNativeType());
|
||||
pvStructure = createPVStructure(channel, getType, pvRequest);
|
||||
@@ -712,6 +714,8 @@ void CAChannelGet::channelCreated(const Status& status,Channel::shared_pointer c
|
||||
}
|
||||
ChannelGetRequester::shared_pointer getRequester(channelGetRequester.lock());
|
||||
if(!getRequester) return;
|
||||
PVStructurePtr pvRequest(pvRequestWeak.lock());
|
||||
if(!pvRequest) return;
|
||||
chtype newType = getDBRType(pvRequest, channel->getNativeType());
|
||||
if(newType!=getType) {
|
||||
getType = getDBRType(pvRequest, channel->getNativeType());
|
||||
@@ -1211,7 +1215,7 @@ CAChannelPut::CAChannelPut(CAChannel::shared_pointer const & channel,
|
||||
:
|
||||
channel(channel),
|
||||
channelPutRequester(channelPutRequester),
|
||||
pvRequest(pvRequest),
|
||||
pvRequestWeak(pvRequest),
|
||||
block(false)
|
||||
{
|
||||
if(DEBUG_LEVEL>0) {
|
||||
@@ -1226,6 +1230,8 @@ void CAChannelPut::activate()
|
||||
}
|
||||
ChannelPutRequester::shared_pointer putRequester(channelPutRequester.lock());
|
||||
if(!putRequester) return;
|
||||
PVStructurePtr pvRequest(pvRequestWeak.lock());
|
||||
if(!pvRequest) return;
|
||||
if(pvStructure) throw std::runtime_error("CAChannelPut::activate() was called twice");
|
||||
getType = getDBRType(pvRequest,channel->getNativeType());
|
||||
pvStructure = createPVStructure(channel, getType, pvRequest);
|
||||
@@ -1251,6 +1257,8 @@ void CAChannelPut::channelCreated(const Status& status,Channel::shared_pointer c
|
||||
}
|
||||
ChannelPutRequester::shared_pointer putRequester(channelPutRequester.lock());
|
||||
if(!putRequester) return;
|
||||
PVStructurePtr pvRequest(pvRequestWeak.lock());
|
||||
if(!pvRequest) return;
|
||||
chtype newType = getDBRType(pvRequest, channel->getNativeType());
|
||||
if(newType!=getType) {
|
||||
getType = getDBRType(pvRequest, channel->getNativeType());
|
||||
@@ -1736,7 +1744,7 @@ CAChannelMonitor::CAChannelMonitor(
|
||||
:
|
||||
channel(channel),
|
||||
monitorRequester(monitorRequester),
|
||||
pvRequest(pvRequest),
|
||||
pvRequestWeak(pvRequest),
|
||||
isStarted(false)
|
||||
{
|
||||
if(DEBUG_LEVEL>0) {
|
||||
@@ -1751,6 +1759,8 @@ void CAChannelMonitor::activate()
|
||||
}
|
||||
MonitorRequester::shared_pointer requester(monitorRequester.lock());
|
||||
if(!requester) return;
|
||||
PVStructurePtr pvRequest(pvRequestWeak.lock());
|
||||
if(!pvRequest) return;
|
||||
if(pvStructure) throw std::runtime_error("CAChannelMonitor::activate() was called twice");
|
||||
getType = getDBRType(pvRequest, channel->getNativeType());
|
||||
pvStructure = createPVStructure(channel, getType, pvRequest);
|
||||
@@ -1781,6 +1791,8 @@ void CAChannelMonitor::channelCreated(const Status& status,Channel::shared_point
|
||||
}
|
||||
MonitorRequester::shared_pointer requester(monitorRequester.lock());
|
||||
if(!requester) return;
|
||||
PVStructurePtr pvRequest(pvRequestWeak.lock());
|
||||
if(!pvRequest) return;
|
||||
chtype newType = getDBRType(pvRequest, channel->getNativeType());
|
||||
if(newType!=getType) {
|
||||
getType = getDBRType(pvRequest, channel->getNativeType());
|
||||
|
||||
Reference in New Issue
Block a user