mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 08:55:54 +03:00
Fix crash after hangup due to modifying a list while iterating over it
"endPeerConnection()" removes the item from the list, so neither a for-each loop nor an iterator can be used to traverse the list (as a "ConcurrentModificationException" would be thrown). To solve that now the list of connections is first traversed to get all the sessions, and then the list of sessions is traversed to end the connections. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
53e3543839
commit
8364877f38
1 changed files with 5 additions and 1 deletions
|
@ -1707,8 +1707,12 @@ public class CallActivity extends CallBaseActivity {
|
|||
}
|
||||
}
|
||||
|
||||
List<String> sessionIdsToEnd = new ArrayList<String>(peerConnectionWrapperList.size());
|
||||
for (PeerConnectionWrapper wrapper : peerConnectionWrapperList) {
|
||||
endPeerConnection(wrapper.getSessionId(), false);
|
||||
sessionIdsToEnd.add(wrapper.getSessionId());
|
||||
}
|
||||
for (String sessionId : sessionIdsToEnd) {
|
||||
endPeerConnection(sessionId, false);
|
||||
}
|
||||
|
||||
if (localStream != null) {
|
||||
|
|
Loading…
Reference in a new issue