Bugfixes part 3 #209

Open
andrey wants to merge 37 commits from bugfixes3 into master
Showing only changes of commit 288c1b3575 - Show all commits
+8 -3
View File
@@ -1234,9 +1234,14 @@ void PIConnection::Sender::tick(int) {
if (data.isEmpty()) return;
// 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);
int ret = d->write(data);
if (ret > 0) {
PIDiagnostics * diag = nullptr;
__device_pool__->lock();
diag = parent->diags_.value(d, nullptr);
__device_pool__->unlock();
if (diag) diag->sended(ret);
}
}
}