From 51713d309a08d1040d883a226d0f82a832c7eb2d Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Sat, 23 Oct 2021 11:02:13 +0300 Subject: [PATCH] policy-{node,endpoint-device}: do not hold reference to si_link in closure This may keep the link alive for longer than expected --- src/scripts/policy-endpoint-device.lua | 2 +- src/scripts/policy-node.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/policy-endpoint-device.lua b/src/scripts/policy-endpoint-device.lua index 2bf8f88d..04e3bc62 100644 --- a/src/scripts/policy-endpoint-device.lua +++ b/src/scripts/policy-endpoint-device.lua @@ -97,7 +97,7 @@ function createLink (si_ep, si_target) si_link:activate (Feature.SessionItem.ACTIVE, function (l, e) if e then Log.warning (l, "failed to activate si-standard-link: " .. tostring(e)) - si_link:remove () + l:remove () else Log.info (l, "activated si-standard-link") end diff --git a/src/scripts/policy-node.lua b/src/scripts/policy-node.lua index e982a09d..55264d27 100644 --- a/src/scripts/policy-node.lua +++ b/src/scripts/policy-node.lua @@ -66,7 +66,7 @@ function createLink (si, si_target, passthrough, exclusive) si_link:activate (Feature.SessionItem.ACTIVE, function (l, e) if e then Log.warning (l, "failed to activate si-standard-link: " .. tostring(e)) - si_link:remove () + l:remove () else Log.info (l, "activated si-standard-link") end