From a1fdcf802a3c90c3dfac202642dc89131db69095 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Mon, 25 May 2026 08:57:02 +0300 Subject: [PATCH] Synched adding and removing of calls --- app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index aa9375af..b00f9f60 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -1990,7 +1990,9 @@ class BaresipService: Service() { } }) - calls.add(call) + synchronized(calls) { + calls.add(call) + } setCallVolume() ensureCommunicationMode() @@ -2028,7 +2030,9 @@ class BaresipService: Service() { if (call.dir == "in" && call.startTime == null && !call.rejected) call.ua.account.missedCalls = true } - calls.remove(call) + synchronized(calls) { + calls.remove(call) + } postServiceEvent( ServiceEvent( "call closed", arrayListOf(uap, callp), System.nanoTime()