You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2021/10/20 09:43:04 UTC
[rocketmq-client-cpp] branch main updated: Bugfix: map iterator is
out of bounds (#372)
This is an automated email from the ASF dual-hosted git repository.
lizhanhui pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new cc2af6d Bugfix: map iterator is out of bounds (#372)
cc2af6d is described below
commit cc2af6dbe95bac5c5ff9c10498c451402c6b9d0c
Author: aaron ai <ya...@gmail.com>
AuthorDate: Wed Oct 20 17:42:57 2021 +0800
Bugfix: map iterator is out of bounds (#372)
---
src/main/cpp/tracing/exporters/OtlpExporter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/cpp/tracing/exporters/OtlpExporter.cpp b/src/main/cpp/tracing/exporters/OtlpExporter.cpp
index 7ad9f5b..41796ba 100644
--- a/src/main/cpp/tracing/exporters/OtlpExporter.cpp
+++ b/src/main/cpp/tracing/exporters/OtlpExporter.cpp
@@ -94,7 +94,7 @@ void OtlpExporterHandler::syncExportClients() {
std::vector<std::string>&& hosts = exp->hosts();
{
absl::MutexLock lk(&clients_map_mtx_);
- for (auto i = clients_map_.begin(); i != clients_map_.end(); i++) {
+ for (auto i = clients_map_.begin(); i != clients_map_.end();) {
if (std::none_of(hosts.cbegin(), hosts.cend(), [&](const std::string& host) { return i->first == host; })) {
clients_map_.erase(i++);
} else {