Skip to content

Commit

Permalink
contactSignalingEndpointconnectedSignalingEndpoint を nullにするタイ…
Browse files Browse the repository at this point in the history
…ミングを修正
  • Loading branch information
zztkm committed Feb 25, 2025
1 parent 4aadb31 commit d1ff25e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
- [ADD] サイマルキャストの映像のエンコーディングパラメーター `scaleResolutionDownTo` を追加する
- @zztkm
- [FIX] `SoraMediaChannel.internalDisconnect` での `SoraMediaChannel.Listener.onClose` の呼び出しタイミングを切断処理がすべて完了したあとに修正する
- 説明には「Sora との接続が切断されたときに呼び出される」と記載していたが、実際には切断処理が完了する前に呼び出していたので、説明に合わせて修正を行った
- 説明には「Sora との接続が切断されたときに呼び出される」と記載していたが、実際には切断処理が完了する前に呼び出していたので、説明に合わせて修正
- `contactSignalingEndpoint``connectedSignalingEndpoint` は onClose で参照される可能性があるため、onClose 実行よりあとに null になるように onClose に合わせて処理順を変更
- @zztkm

## 2025.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,10 +957,6 @@ class SoraMediaChannel @JvmOverloads constructor(
}
compositeDisposable.dispose()

// アプリケーションで定義された切断処理を実行した後に contactSignalingEndpoint と connectedSignalingEndpoint を null にする
contactSignalingEndpoint = null
connectedSignalingEndpoint = null

// 既に type: disconnect を送信しているので、 disconnectReason は null で良い
signaling?.disconnect(null)
signaling = null
Expand All @@ -974,6 +970,10 @@ class SoraMediaChannel @JvmOverloads constructor(

listener?.onClose(this)
listener = null

// onClose によってアプリケーションで定義された切断処理を実行した後に contactSignalingEndpoint と connectedSignalingEndpoint を null にする
contactSignalingEndpoint = null
connectedSignalingEndpoint = null
}

private fun sendDisconnectOverWebSocket(disconnectReason: SoraDisconnectReason) {
Expand Down

0 comments on commit d1ff25e

Please sign in to comment.