Fix memory leak in terrain filter matching
(cherry-picked from commit f861883683
)
This commit is contained in:
parent
94d28391a6
commit
d99d6bb551
1 changed files with 2 additions and 1 deletions
|
@ -335,7 +335,8 @@ bool terrain_filter::match_internal(const map_location& loc, const unit* ref_uni
|
|||
callable.add("teleport_unit", wfl::variant(ref));
|
||||
// It's not destroyed upon scope exit because the variant holds a reference
|
||||
}
|
||||
const wfl::formula form(cfg_["formula"], new wfl::gamestate_function_symbol_table);
|
||||
wfl::gamestate_function_symbol_table symbols;
|
||||
const wfl::formula form(cfg_["formula"], &symbols);
|
||||
if(!form.evaluate(callable).as_bool()) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue