Skip to content

Commit

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

## 2025.1.0

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

listener?.onClose(this)
listener = null

// アプリケーションで定義された切断処理を実行した後に contactSignalingEndpoint と connectedSignalingEndpoint を null にする
contactSignalingEndpoint = null
connectedSignalingEndpoint = null
Expand All @@ -974,6 +971,9 @@ class SoraMediaChannel @JvmOverloads constructor(
// 既に type: disconnect を送信しているので、 disconnectReason は null で良い
peer?.disconnect(null)
peer = null

listener?.onClose(this)
listener = null
}

private fun sendDisconnectOverWebSocket(disconnectReason: SoraDisconnectReason) {
Expand Down

0 comments on commit 4aadb31

Please sign in to comment.