jdk/src/java.desktop/unix/native/common/awt/awt.h
changeset 32123 92824eb030c5
parent 26751 70bac69b37c9
child 37699 c3d9835483f9
--- a/jdk/src/java.desktop/unix/native/common/awt/awt.h	Wed Jul 29 11:33:02 2015 +0400
+++ b/jdk/src/java.desktop/unix/native/common/awt/awt.h	Wed Jul 29 20:32:35 2015 +0300
@@ -82,7 +82,12 @@
     } while (0)
 
 #define AWT_LOCK_IMPL() \
-    (*env)->CallStaticVoidMethod(env, tkClass, awtLockMID)
+    do { \
+        (*env)->CallStaticVoidMethod(env, tkClass, awtLockMID); \
+        if ((*env)->ExceptionCheck(env)) { \
+            (*env)->ExceptionClear(env); \
+        } \
+    } while(0)
 
 #define AWT_NOFLUSH_UNLOCK_IMPL() \
     do { \
@@ -91,11 +96,10 @@
          (*env)->ExceptionClear(env); \
       } \
       (*env)->CallStaticVoidMethod(env, tkClass, awtUnlockMID); \
+      if ((*env)->ExceptionCheck(env)) { \
+         (*env)->ExceptionClear(env); \
+      } \
       if (pendingException) { \
-         if ((*env)->ExceptionCheck(env)) { \
-            (*env)->ExceptionDescribe(env); \
-            (*env)->ExceptionClear(env); \
-         } \
          (*env)->Throw(env, pendingException); \
       } \
     } while (0)