Fix memory leak in terrain filter matching

(cherry-picked from commit f861883683)
This commit is contained in:
Jyrki Vesterinen 2018-05-24 20:21:03 +03:00
parent 94d28391a6
commit d99d6bb551

View file

@ -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;
}