diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2021-06-23 08:54:02 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2021-06-23 08:57:03 +0900 |
commit | 25f5c19c857e2c47b893a6c45abd2c6c02fb0dd9 (patch) | |
tree | c24499811969ebc45fa053708a3ffa324cab0642 | |
parent | 20172c69d140bfaa3cb64b61d6c70a68a5e1deea (diff) | |
download | aul-1-25f5c19c857e2c47b893a6c45abd2c6c02fb0dd9.tar.gz aul-1-25f5c19c857e2c47b893a6c45abd2c6c02fb0dd9.tar.bz2 aul-1-25f5c19c857e2c47b893a6c45abd2c6c02fb0dd9.zip |
Fix retrieving app com connections
To allow delete this, app com uses std::iterator. After this patch is
applied, the caller process can call aul_app_com_leave() while calling
the app_com_cb() callback function.
Change-Id: I0e6202810d99af556197c35b9c06303185e25482
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | src/app_com.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/app_com.cc b/src/app_com.cc index ac1d988e..e992b88a 100644 --- a/src/app_com.cc +++ b/src/app_com.cc @@ -101,7 +101,10 @@ class Context { std::string endpoint(val); std::lock_guard<std::recursive_mutex> lock(mutex_); - for (auto& conn : conns_) { + auto iter = conns_.begin(); + while (iter != conns_.end()) { + auto& conn = *iter; + iter++; if (conn->GetEndpoint() == endpoint) conn->Invoke(*result, b); } |