From 68f44da1c29f2d8561db1930a231e08d4c555fd3 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 17 Oct 2014 15:35:48 +0200 Subject: [PATCH] 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 --- .../com/intellij/ide/util/gotoByName/ChooseByNameBase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java index 5b46d5bfb186..cc005b1929ad 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java @@ -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); } };