fixing ChooseByNameBase assertions

* list update is requested
* bg thread is canceled, a new one is started
* then quickly a write action occurs
* old bg thread hasn't finished yet and receives that event and restarts
=> two bg threads at the same time, bad
This commit is contained in:
peter
2014-10-17 15:39:44 +02:00
parent e5de5c2c4a
commit 68f44da1c2
@@ -1521,8 +1521,9 @@ public abstract class ChooseByNameBase {
ApplicationAdapter listener = new ApplicationAdapter() {
@Override
public void beforeWriteActionStart(Object action) {
cancel();
scheduleRestart();
if (cancel()) {
scheduleRestart(); //don't restart if already canceled explicitly
}
ApplicationManager.getApplication().removeApplicationListener(this);
}
};