Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ class GlStreamInterface(private val context: Context): OnFrameAvailableListener,
surfaceManager.swapBuffer()
}
}
val previewSnapshot = multiPreviewSurfaceManagers.values.toList()
// Not toList(): for one element it calls iterator().next(), which throws NoSuchElementException
// if that surface is removed from another thread in between. ArrayList copies via toArray(), which can't.
val previewSnapshot = ArrayList(multiPreviewSurfaceManagers.values)
previewSnapshot.forEach { info ->
if (info.surfaceManager.isReady) {
if (info.surfaceManager.makeCurrent()) {
Expand Down
Loading