SharedPV too many notifiedConn

notifiedConn set more often than it should.
This commit is contained in:
Michael Davidsaver
2018-10-03 10:54:26 -07:00
parent e67e00c968
commit 421d50e3ba

View File

@@ -48,10 +48,11 @@ SharedChannel::SharedChannel(const std::tr1::shared_ptr<SharedPV> &owner,
SharedPV::Handler::shared_pointer handler;
{
Guard G(owner->mutex);
if(owner->channels.empty())
if(owner->channels.empty()) {
handler = owner->handler;
owner->notifiedConn = true;
}
owner->channels.push_back(this);
owner->notifiedConn = true;
}
if(handler) {
handler->onFirstConnect(owner);