fix(essentials): add local scope variable for indexer in hold/resume call loop

This commit is contained in:
Neil Dorin
2022-02-09 16:46:19 -07:00
parent 102ae3ad4f
commit db67f97a1f

View File

@@ -1218,9 +1218,13 @@ ScreenIndexIsPinnedTo: {8} (a{17})
{ {
for (int i = 0; i < joinMap.HoldCallsStart.JoinSpan; i++) for (int i = 0; i < joinMap.HoldCallsStart.JoinSpan; i++)
{ {
trilist.SetSigFalseAction((uint)(joinMap.HoldCallsStart.JoinNumber + i), () => var index = i;
trilist.SetSigFalseAction((uint)(joinMap.HoldCallsStart.JoinNumber + index), () =>
{ {
var call = ActiveCalls[i]; if (index < 0 || index >= ActiveCalls.Count) return;
var call = ActiveCalls[index];
if (call != null) if (call != null)
{ {
holdCodec.HoldCall(call); holdCodec.HoldCall(call);
@@ -1231,9 +1235,11 @@ ScreenIndexIsPinnedTo: {8} (a{17})
} }
}); });
trilist.SetSigFalseAction((uint)(joinMap.ResumeCallsStart.JoinNumber + i), () => trilist.SetSigFalseAction((uint)(joinMap.ResumeCallsStart.JoinNumber + index), () =>
{ {
var call = ActiveCalls[i]; if (index < 0 || index >= ActiveCalls.Count) return;
var call = ActiveCalls[index];
if (call != null) if (call != null)
{ {
holdCodec.ResumeCall(call); holdCodec.ResumeCall(call);