changeset 5566:c3039823f622

8000297: REGRESSION: closed/java/awt/EventQueue/PostEventOrderingTest.java fails Reviewed-by: art, dholmes
author bagiras
date Tue, 02 Oct 2012 13:00:49 +0400
parents b5b35ef6e048
children b43b874ea9ee
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 Oct 02 12:54:45 2012 +0400
+++ b/src/share/classes/sun/awt/SunToolkit.java	Tue Oct 02 13:00:49 2012 +0400
@@ -505,15 +505,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();
         }
     }