changeset 5311:cebe174fb519

7188708: REGRESSION: closed/java/awt/EventQueue/PostEventOrderingTest.java fails Reviewed-by: art, dholmes
author bagiras
date Tue, 11 Sep 2012 13:10:55 +0400
parents 3879f46e4c72
children 7c3ffcb3ff8f
files src/share/classes/sun/awt/SunToolkit.java
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/awt/SunToolkit.java	Tue Sep 11 12:36:32 2012 +0400
+++ b/src/share/classes/sun/awt/SunToolkit.java	Tue Sep 11 13:10:55 2012 +0400
@@ -556,15 +556,19 @@
             // Don't call flushPendingEvents() recursively
             if (!isFlushingPendingEvents) {
                 isFlushingPendingEvents = true;
-                AppContext appContext = AppContext.getAppContext();
-                PostEventQueue postEventQueue =
-                    (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
-                if (postEventQueue != null) {
-                    postEventQueue.flush();
+                try {
+                    AppContext appContext = AppContext.getAppContext();
+                    PostEventQueue postEventQueue =
+                        (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
+                    if (postEventQueue != null) {
+                        postEventQueue.flush();
+                    }
+                }
+                finally {
+                    isFlushingPendingEvents = false;
                 }
             }
         } finally {
-            isFlushingPendingEvents = false;
             flushLock.unlock();
         }
     }