Skip to content

Commit

Permalink
Fixed #749.
Browse files Browse the repository at this point in the history
Fixed invalidated iterator use.
  • Loading branch information
redboltz committed Dec 4, 2020
1 parent 1455059 commit f659bee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/mqtt/broker/broker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,8 @@ class broker {
}
else {
// new connection
it = idx.emplace_hint(
it,
bool inserted;
std::tie(it, inserted) = idx.emplace(
ioc_,
subs_map_,
spep,
Expand All @@ -992,6 +992,7 @@ class broker {
force_move(will_expiry_interval),
force_move(session_expiry_interval)
);
BOOST_ASSERT(inserted);
send_connack(false);
}
}
Expand Down

0 comments on commit f659bee

Please sign in to comment.