mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Added message callback functionality in c and canceled error downgrading on user callbacks in communication as well
This commit is contained in:
@@ -156,11 +156,14 @@ void Communication::readTask() {
|
||||
|
||||
std::lock_guard<std::mutex> lk(messageCallbacksLock);
|
||||
|
||||
// We want callbacks to be able to access errors
|
||||
EventManager::GetInstance().cancelErrorDowngradingOnCurrentThread();
|
||||
for(auto& cb : messageCallbacks) {
|
||||
if(!closing) { // We might have closed while reading or processing
|
||||
cb.second.callIfMatch(msg);
|
||||
}
|
||||
}
|
||||
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user