这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit 0308d6a

Browse files
author
Leonid Pliushch
committed
extra keys: avoid scheduled executor leak
Under certain cases scheduled executor may leak causing repeatable input to stuck. Issue: #2156
1 parent 1b62f7c commit 0308d6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/src/main/java/com/termux/app/terminal/io/extrakeys/ExtraKeysView.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ public void reload(ExtraKeysInfo infos) {
302302
case MotionEvent.ACTION_DOWN:
303303
longPressCount = 0;
304304
v.setBackgroundColor(BUTTON_PRESSED_COLOR);
305+
if (scheduledExecutor != null) {
306+
scheduledExecutor.shutdownNow();
307+
scheduledExecutor = null;
308+
}
305309
if (Arrays.asList("UP", "DOWN", "LEFT", "RIGHT", "BKSP", "DEL").contains(buttonInfo.getKey())) {
306310
// autorepeat
307311
scheduledExecutor = Executors.newSingleThreadScheduledExecutor();

0 commit comments

Comments
 (0)