X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=9fa64d0703ae5d973453db0abb998661eb76fe20;hb=0525b2ed026e0d510fdf23f6d8f4cb4562a17e0b;hp=ee2e9de86664a04a238070b40637dff35a393176;hpb=051e29138b18fb4b731a72f8727475b10e4c74e4;p=fanfix.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index ee2e9de..9fa64d0 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -1125,8 +1125,14 @@ public class TApplication implements Runnable { } secondaryEventReceiver.handleEvent(event); - if (doubleClick != null) { - secondaryEventReceiver.handleEvent(doubleClick); + // Note that it is possible for secondaryEventReceiver to be null + // now, because its handleEvent() might have finished out on the + // secondary thread. So put any extra processing inside a null + // check. + if (secondaryEventReceiver != null) { + if (doubleClick != null) { + secondaryEventReceiver.handleEvent(doubleClick); + } } } @@ -1199,7 +1205,8 @@ public class TApplication implements Runnable { keepTimers.add(timer); } } - timers = keepTimers; + timers.clear(); + timers.addAll(keepTimers); } // Call onIdle's