From: sfan5 Date: Tue, 18 Jan 2022 18:25:53 +0000 (+0100) Subject: Free arguments of cancelled minetest.after() jobs X-Git-Tag: 2022.05~5^2~238 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=4f6f09590c65187071096cceac5872293bc53b2f;p=dragonfireclient.git Free arguments of cancelled minetest.after() jobs --- diff --git a/builtin/common/after.lua b/builtin/common/after.lua index e20f292f0..bce262537 100644 --- a/builtin/common/after.lua +++ b/builtin/common/after.lua @@ -37,7 +37,14 @@ function core.after(after, func, ...) arg = {...}, mod_origin = core.get_last_run_mod(), } + jobs[#jobs + 1] = new_job time_next = math.min(time_next, expire) - return { cancel = function() new_job.func = function() end end } + + return { + cancel = function() + new_job.func = function() end + new_job.args = {} + end + } end