Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(offlinemsg): don't invalidate iterator before use
Browse files Browse the repository at this point in the history
QMap::erase invalidates the iterator, meaning our usage of it on the
next line was unsafe.
  • Loading branch information
anthonybilinski committed Nov 27, 2019
1 parent 479b39f commit 1f80173
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/persistence/offlinemsgengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ void OfflineMsgEngine::removeAllMessages()
void OfflineMsgEngine::completeMessage(QMap<ReceiptNum, OfflineMessage>::iterator msgIt)
{
msgIt->completionFn();
sentMessages.erase(msgIt);
receivedReceipts.removeOne(msgIt.key());
sentMessages.erase(msgIt);
}

void OfflineMsgEngine::checkForCompleteMessages(ReceiptNum receipt)
Expand Down

0 comments on commit 1f80173

Please sign in to comment.