This commit is contained in:
Michael Davidsaver
2016-03-16 22:33:23 -04:00
parent 3215a280da
commit 65636d8d8c
6 changed files with 45 additions and 47 deletions

View File

@ -134,10 +134,11 @@ struct BaseChannel : public epics::pvAccess::Channel
* Derived class may use onStart(), onStop(), and requestUpdate()
* to react to subscriber events.
*/
struct BaseMonitor : public epics::pvAccess::Monitor,
public std::tr1::enable_shared_from_this<BaseMonitor>
struct BaseMonitor : public epics::pvAccess::Monitor
{
POINTER_DEFINITIONS(BaseMonitor);
weak_pointer weakself;
inline shared_pointer shared_from_this() { return shared_pointer(weakself); }
typedef epics::pvAccess::MonitorRequester requester_t;
@ -175,13 +176,12 @@ public:
{
epics::pvData::StructureConstPtr dtype(value->getStructure());
epics::pvData::PVDataCreatePtr create(epics::pvData::getPVDataCreate());
BaseMonitor::shared_pointer self;
BaseMonitor::shared_pointer self(shared_from_this());
requester_t::shared_pointer req;
{
guard_t G(lock);
assert(!complete); // can't call twice
self = shared_from_this();
req = requester;
complete = value;