Skip to content

Commit 095e934

Browse files
committed
TermService: unset FinishCallbacks before calling session.finish() in onDestroy()
Prevents a ConcurrentModificationException when there are multiple sessions to finish in onDestroy().
1 parent cb90a41 commit 095e934

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/jackpal/androidterm/TermService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public void onCreate() {
8484
public void onDestroy() {
8585
compat.stopForeground(true);
8686
for (TermSession session : mTermSessions) {
87+
/* Don't automatically remove from list of sessions -- we clear the
88+
* list below anyway and we could trigger
89+
* ConcurrentModificationException if we do */
90+
session.setFinishCallback(null);
8791
session.finish();
8892
}
8993
mTermSessions.clear();

0 commit comments

Comments
 (0)