Skip to content

Commit 67d4ec2

Browse files
authored
Issue #114 Avoiding crash by removing elements of the buffer we are iterating over
More information in: #114
1 parent 1c841d3 commit 67d4ec2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wintoastlib.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,8 @@ void WinToast::clear() {
908908
return;
909909
}
910910

911-
for (auto& data : _buffer) {
911+
auto safeCopy = _buffer;
912+
for (auto& data : safeCopy) {
912913
auto& notifyData = data.second;
913914
notify->Hide(notifyData.notification());
914915
notifyData.RemoveTokens();

0 commit comments

Comments
 (0)