AbstractPopup: defer final runnable execution

myFinalRunnable can contain logic which removes focus listeners (e.g. the runnable can invoke change color scheme action).
In case we're called from a focus listener, which is called from java.awt.AWTEventMulticaster,
removal of focus listeners will not have effect as the focus listeners list is copied on each modification.
So focus listeners which have already been removed, will get invoked. Hence, we defer the final runnable execution.
This commit is contained in:
Sergey Savenko
2015-02-10 13:56:53 +03:00
parent 3dd6a85424
commit 0ffaa2e36f
@@ -1348,9 +1348,10 @@ public class AbstractPopup implements JBPopup {
Runnable runFinal = new Runnable() {
@Override
public void run() {
//noinspection SSBasedInspection
SwingUtilities.invokeLater(myFinalRunnable);
//noinspection SSBasedInspection
SwingUtilities.invokeLater(typeAheadDone.createSetDoneRunnable());
myFinalRunnable.run();
myFinalRunnable = null;
}
};