Skip to content

Commit eca4d11

Browse files
committed
Keep reference to CBL2CAPChannel so the system doesn't close it
1 parent 29926bc commit eca4d11

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/CombineCoreBluetooth/Models/L2CAPChannel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Foundation
2+
import CoreBluetooth
23

34
public struct L2CAPChannel {
5+
// Need to keep a reference to this so the system doesn't close the channel
6+
let rawValue: CBL2CAPChannel
47
public let peer: Peer
58
public let inputStream: InputStream
69
public let outputStream: OutputStream
@@ -19,6 +22,7 @@ extension L2CAPChannel {
1922
}
2023

2124
self.init(
25+
rawValue: channel,
2226
peer: peer,
2327
inputStream: channel.inputStream,
2428
outputStream: channel.outputStream,

0 commit comments

Comments
 (0)