diff --git a/common/libeval/numeric_evaluator.cpp b/common/libeval/numeric_evaluator.cpp index 6945f715bc..46884113ce 100644 --- a/common/libeval/numeric_evaluator.cpp +++ b/common/libeval/numeric_evaluator.cpp @@ -96,12 +96,14 @@ NumericEvaluator :: init() } void -NumericEvaluator :: clear() +NumericEvaluator :: clear(const void* pObj) { free(clToken.token); clToken.token = nullptr; clToken.input = nullptr; bClError = true; + + if (bClTextInputStorage && pObj) clObjMap.erase(pObj); } void diff --git a/include/libeval/numeric_evaluator.h b/include/libeval/numeric_evaluator.h index 274c22e14a..000c913790 100644 --- a/include/libeval/numeric_evaluator.h +++ b/include/libeval/numeric_evaluator.h @@ -100,10 +100,10 @@ public: /* Initialization and destruction. init() is invoked be the constructor and should not be needed * by the user. * clear() should be invoked by the user if a new input string is to be processed. It will reset - * the parser. User defined variables are retained. + * the parser and clear the original expression value for a requested object (if pObj != null). */ void init(); - void clear(); + void clear(const void* pObj = nullptr); /* Set the decimal separator for the input string. Defaults to '.' */ void setDecimalSeparator(char sep);