changeset 9929:70611796ac6b

8054800: JNI exception pending in jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp Reviewed-by: azvegint, prr
author serb
date Wed, 13 Aug 2014 21:45:53 +0400
parents 82b627591c4c
children 2bdb5b65ceb1
files src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Mon Aug 11 22:09:48 2014 +0800
+++ b/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Wed Aug 13 21:45:53 2014 +0400
@@ -835,13 +835,17 @@
     TRY;
 
     /* class ids */
-    AwtWin32GraphicsDevice::indexCMClass =
-        (jclass)env->NewGlobalRef(env->FindClass("java/awt/image/IndexColorModel"));
+    jclass iCMClass = env->FindClass("java/awt/image/IndexColorModel");
+    CHECK_NULL(iCMClass);
+    AwtWin32GraphicsDevice::indexCMClass = (jclass) env->NewGlobalRef(iCMClass);
+    env->DeleteLocalRef(iCMClass);
     DASSERT(AwtWin32GraphicsDevice::indexCMClass);
     CHECK_NULL(AwtWin32GraphicsDevice::indexCMClass);
 
-    AwtWin32GraphicsDevice::wToolkitClass =
-        (jclass)env->NewGlobalRef(env->FindClass("sun/awt/windows/WToolkit"));
+    jclass wTClass = env->FindClass("sun/awt/windows/WToolkit");
+    CHECK_NULL(wTClass);
+    AwtWin32GraphicsDevice::wToolkitClass = (jclass)env->NewGlobalRef(wTClass);
+    env->DeleteLocalRef(wTClass);
     DASSERT(AwtWin32GraphicsDevice::wToolkitClass);
     CHECK_NULL(AwtWin32GraphicsDevice::wToolkitClass);