Re-acquire state lock before checking if any fields were set by the state listener
@@ -274,6 +274,7 @@ StateManager::notifyStateListeners()
listener->handleNewState();
// If one of them actually altered the state again, abort
// sending events, update states and send new one to all.
+ std::lock_guard guard(_stateLock);
if (_nextNodeState || _nextSystemState) {
break;
}
