From d69a6ec647d7f78eac7cf25586df9ab2ae2dec41 Mon Sep 17 00:00:00 2001 From: lewisgross1296 Date: Mon, 15 Aug 2022 13:43:53 -0500 Subject: [PATCH] [skip ci] erasing the tally from the tallies vector calls the destructor, which already handles removing this tally from the map --- src/tallies/tally.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index f45fae9940..59adce455d 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -1281,8 +1281,8 @@ extern "C" int openmc_remove_tally(int32_t index) } // grab tally so it's ID can be obtained to remove the (ID,index) pair from tally_map auto& tally = model::tallies[index]; - model::tally_map.erase(tally->id_); // delete the tally via iterator pointing to correct position + // this calls the Tally destructor, removing the tally from the map as well model::tallies.erase(model::tallies.begin() + index); return 0;