Skip to content

Commit c5a7128

Browse files
committed
add back swift defer
1 parent c4cee43 commit c5a7128

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native-sdk/ios/StreamInCallManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class StreamInCallManager: RCTEventEmitter {
142142

143143
if currentCategory != intendedCategory.rawValue || currentMode != intendedMode.rawValue || currentOptions != intendedOptions || !currentIsActive {
144144
session.lockForConfiguration()
145+
defer { session.unlockForConfiguration() }
145146
do {
146147
try session.setCategory(intendedCategory, mode: intendedMode, options: intendedOptions)
147148
try session.setActive(true)
@@ -156,7 +157,6 @@ class StreamInCallManager: RCTEventEmitter {
156157
log("configureAudioSession: Error setting mode: \(error.localizedDescription)")
157158
}
158159
}
159-
session.unlockForConfiguration()
160160
} else {
161161
log("configureAudioSession: no change needed")
162162
}

0 commit comments

Comments
 (0)