From 72ba5610307d849279d6a1bea45c253740289628 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Thu, 21 Nov 2024 14:16:00 -0800 Subject: [PATCH] This is a hack fix for issue 320, but it works. This fixes the bug in Antimony where somehow the order of deletion causes a crash here at the end of the program. It wouldn't work if I actually used mModelValues, but I don't, and figuring out the actual cause is too much work, sadly. --- src/sbml/SBMLTransforms.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sbml/SBMLTransforms.cpp b/src/sbml/SBMLTransforms.cpp index b6187c1c4c..b47c90719c 100644 --- a/src/sbml/SBMLTransforms.cpp +++ b/src/sbml/SBMLTransforms.cpp @@ -553,7 +553,9 @@ SBMLTransforms::clearComponentValues(const Model* m) } // otherwise remove only specific set - mModelValues.erase(m); + if (!mModelValues.empty()) { + mModelValues.erase(m); + } }