Revert "Address potential memleak during WFL parsing (#1680)"
This reverts commits61ec2d0008
and8f6a0830ee
opens #1680
This commit is contained in:
parent
431b4225b6
commit
33792a3b1e
2 changed files with 6 additions and 11 deletions
|
@ -66,12 +66,12 @@ expression_ptr parse_expression(const tk::token* i1, const tk::token* i2, functi
|
|||
const char* const formula::id_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
|
||||
|
||||
formula::formula(const std::string& text, function_symbol_table* symbols)
|
||||
try : managing_symbols(symbols == nullptr)
|
||||
, symbols_(symbols)
|
||||
, expr_()
|
||||
: expr_()
|
||||
, str_(text)
|
||||
, symbols_(symbols)
|
||||
, managing_symbols(symbols == nullptr)
|
||||
{
|
||||
if(managing_symbols) {
|
||||
if(symbols == nullptr) {
|
||||
symbols_ = new function_symbol_table;
|
||||
}
|
||||
|
||||
|
@ -208,11 +208,6 @@ try : managing_symbols(symbols == nullptr)
|
|||
} else {
|
||||
expr_ = expression_ptr(new null_expression());
|
||||
}
|
||||
} catch(...) {
|
||||
if(managing_symbols) {
|
||||
delete symbols_;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
|
||||
formula::formula(const tk::token* i1, const tk::token* i2, function_symbol_table* symbols)
|
||||
|
|
|
@ -78,10 +78,10 @@ private:
|
|||
variant execute(const formula_callable& variables, formula_debugger* fdb = nullptr) const;
|
||||
variant execute(formula_debugger* fdb) const;
|
||||
|
||||
bool managing_symbols;
|
||||
function_symbol_table* symbols_;
|
||||
expression_ptr expr_;
|
||||
std::string str_;
|
||||
function_symbol_table* symbols_;
|
||||
bool managing_symbols;
|
||||
|
||||
friend class formula_debugger;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue