Skip to content

Commit

Permalink
Fix memory leak in terrain filter matching
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkive committed May 24, 2018
1 parent 60c93cf commit 57fd9cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/terrain/filter.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 57fd9cc

Please sign in to comment.