File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -154,12 +154,6 @@ public final class MediaChannel {
154154 /// サーバーから通知を受信可能であり、接続中にのみ取得可能です。
155155 public private( set) var subscriberCount : Int ?
156156
157- /// RPC を扱うチャネル
158- /// - Note: RPC が利用不可の場合は nil を返します
159- public var rpcChannel : RPCChannel ? {
160- peerChannel. rpcChannel
161- }
162-
163157 /// RPC で利用可能なメソッド一覧
164158 ///
165159 /// Sora サーバーから通知された RPC メソッドが列挙型として取得できます。
@@ -307,7 +301,9 @@ public final class MediaChannel {
307301 ) async throws -> RPCResponse < M . Result > ? {
308302 let response = try await withCheckedThrowingContinuation {
309303 ( continuation: CheckedContinuation < RPCResponse < Any > ? , Error > ) in
310- guard let rpcChannel else {
304+ // ローカル変数で参照を保持することで rpc メソッド呼び出し時点での
305+ // rpcChannel インスタンス生存を保障する。
306+ guard let rpcChannel = self . peerChannel. rpcChannel else {
311307 continuation. resume (
312308 throwing: SoraError . rpcUnavailable ( reason: " rpc channel is not available " ) )
313309 return
You can’t perform that action at this time.
0 commit comments