Bugfixes part 3 #209
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user