generated from cpp-best-practices/gui_starter_template
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Milestone
Description
MDClientCtx has some threading issues:
The use of the poller thread calling poll() is not thread-safe:
_pollItemsis accessed from the thread without synchronization, that can crash when the MDClient is destroyed while the thread is running. _pollItems is also modified in disconnect()- Other members such as _subscriptions and _requests are accessed without synchronization.
- I think there should be an explicit
poller->request_stop(); poller->join()in ~MDClientCtx
While at it:
if (_subscriptions.contains(receivedEvent.serviceName)) {
_subscriptions.at(receivedEvent.serviceName).callback(receivedEvent); // callback
}
can be replaced by a single lookup (find()) instead of two. Same for _requests below.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
📋 Backlog