From 5f982b8743f1259ef33c586a2d82fef778a5c19e Mon Sep 17 00:00:00 2001 From: Ian Lavery Date: Tue, 1 Aug 2023 16:20:20 -0700 Subject: [PATCH] minor change --- VoiceProcessor.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VoiceProcessor.swift b/VoiceProcessor.swift index 95978bd..c80f75b 100644 --- a/VoiceProcessor.swift +++ b/VoiceProcessor.swift @@ -53,8 +53,10 @@ public class VoiceProcessorErrorListener { /// Function called when a `VoiceProcessorError` occurs. public func onError(_ error: VoiceProcessorError) { lock.lock() + defer { + lock.unlock() + } callback_(error) - lock.unlock() } }