Fix build break issue 65/318265/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 15 Jan 2025 02:14:42 +0000 (11:14 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 15 Jan 2025 02:14:42 +0000 (11:14 +0900)
This patch modifies the implementation about removing the element
from the std::vector.

Change-Id: I8e38a5cbe373325491e27319bedfab1cc2ae6afb
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/process_pool.cc

index 83c27c3332f48e4ae7e61320a646291071535a52..aece83ee83ad9b8cd7ce70b8c77e80a9473d5043 100644 (file)
@@ -223,8 +223,15 @@ void ProcessPool::MarkCloseableFd(int fd) {
 }
 
 void ProcessPool::RemoveFdFromCloseableFds(int fd) {
-  closeable_fds.erase(
-      std::find(closeable_fds.begin(), closeable_fds.end(), fd));
+  auto iter = closeable_fds.begin();
+  while (iter != closeable_fds.end()) {
+    if ((*iter) == fd) {
+      iter = closeable_fds.erase(iter);
+      break;
+    }
+
+    iter++;
+  }
 }
 
 }  // namespace launchpad