From 1c7aaf3d642de2cb9b3764a3dd2b8dd0c0139174 Mon Sep 17 00:00:00 2001 From: Nicholas Nezis Date: Mon, 24 Jan 2022 10:10:21 -0500 Subject: [PATCH] Fixed a segfault issue on macOS. Deleting item invalidated the iterator. --- heron/stmgr/tests/cpp/server/stmgr_unittest.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp b/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp index 36c433fb29a..535d56c48d8 100644 --- a/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp +++ b/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp @@ -682,9 +682,7 @@ void TearCommonResources(CommonResources& common) { common.ss_list_.clear(); - for (auto itr = common.instanceid_instance_.begin(); - itr != common.instanceid_instance_.end(); ++itr) - common.instanceid_instance_.erase(itr->first); + common.instanceid_instance_.clear(); // Clean up the local filesystem state FileUtils::removeRecursive(common.dpath_, true);