Fix resetSubscriptions

This commit is contained in:
LordGrey 2024-04-29 21:31:50 +02:00
parent 42080189ed
commit 571863b15f
2 changed files with 3 additions and 1 deletions

View File

@ -194,6 +194,7 @@ private:
/// priority muxer instance
PriorityMuxer* _prioMuxer;
/// contains active subscriptions
QSet<Subscription::Type> _subscribedCommands;

View File

@ -229,7 +229,8 @@ QStringList JsonCallbacks::unsubscribe(const QJsonArray& subscriptions)
void JsonCallbacks::resetSubscriptions()
{
for (QSet<Subscription::Type>::const_iterator it = _subscribedCommands.constBegin(); it != _subscribedCommands.constEnd(); ++it)
const QSet<Subscription::Type> currentSubscriptions = _subscribedCommands;
for (QSet<Subscription::Type>::const_iterator it = currentSubscriptions.constBegin(); it != currentSubscriptions.constEnd(); ++it)
{
unsubscribe(*it);
}