src/windows/native/sun/windows/awt_new.cpp

Print this page

        

@@ -147,11 +147,11 @@
 // This function is called when a std::bad_alloc exception is caught.
 void
 handle_bad_alloc(void) {
     if (jvm != NULL) {
         JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-        if (env != NULL) {
+        if (env != NULL && !env->ExceptionCheck()) {
             JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
         }
     }
 }