Alarm: don't query current modality state outside EDT (IDEA-163378 JVM Memory View...
authorpeter <peter@jetbrains.com>
Mon, 31 Oct 2016 17:48:39 +0000 (18:48 +0100)
committerpeter <peter@jetbrains.com>
Mon, 31 Oct 2016 18:00:32 +0000 (19:00 +0100)
platform/platform-api/src/com/intellij/util/Alarm.java

index 9dda97dd7deb481fedcc5aae04b338d18c16eebd..5f177c20aca66bea3d6e57f2ebf07f8061366d93 100644 (file)
@@ -172,7 +172,7 @@ public class Alarm implements Disposable {
     if (myThreadToUse != ThreadToUse.SWING_THREAD) return null;
     Application application = ApplicationManager.getApplication();
     if (application == null) return null;
-    return application.getCurrentModalityState();
+    return application.getDefaultModalityState();
   }
 
   public void addRequest(@NotNull Runnable request, long delayMillis) {