From 57fd9cc5867dabcedb951209e955043f51d3272d Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Thu, 24 May 2018 20:21:03 +0300 Subject: [PATCH] Fix memory leak in terrain filter matching --- src/terrain/filter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/terrain/filter.cpp b/src/terrain/filter.cpp index d35f6e308e65..fe2d85b39d9c 100644 --- a/src/terrain/filter.cpp +++ b/src/terrain/filter.cpp @@ -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; }