Bugfixes part 3 #209

Open
andrey wants to merge 37 commits from bugfixes3 into master
Showing only changes of commit 288c1b3575 - Show all commits
+7 -2
View File
@@ -1235,8 +1235,13 @@ void PIConnection::Sender::tick(int) {
// piCoutObj << "write"<<data.size()<<"bytes to"<<devices.size()<<"devices";
for (PIIODevice * d: devices) {
int ret = d->write(data);
PIDiagnostics * diag = parent->diags_.value(d, nullptr);
if (diag && ret > 0) diag->sended(ret);
if (ret > 0) {
PIDiagnostics * diag = nullptr;
__device_pool__->lock();
diag = parent->diags_.value(d, nullptr);
__device_pool__->unlock();
if (diag) diag->sended(ret);
}
}
}