8156116: [macosx] two JNI locals to delete in AWTWindow.m, CGraphicsEnv.m
Reviewed-by: serb, azvegint
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m Fri May 20 10:48:48 2016 +0300
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m Fri May 20 15:48:50 2016 +0300
@@ -811,9 +811,12 @@
if (p.y >= (frame.origin.y + contentRect.size.height)) {
JNIEnv *env = [ThreadUtilities getJNIEnvUncached];
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env];
- // Currently, no need to deliver the whole NSEvent.
- static JNF_MEMBER_CACHE(jm_deliverNCMouseDown, jc_CPlatformWindow, "deliverNCMouseDown", "()V");
- JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown);
+ if (platformWindow != NULL) {
+ // Currently, no need to deliver the whole NSEvent.
+ static JNF_MEMBER_CACHE(jm_deliverNCMouseDown, jc_CPlatformWindow, "deliverNCMouseDown", "()V");
+ JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown);
+ (*env)->DeleteLocalRef(env, platformWindow);
+ }
}
}
}
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m Fri May 20 10:48:48 2016 +0300
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m Fri May 20 15:48:50 2016 +0300
@@ -127,6 +127,7 @@
jc_CGraphicsEnvironment, "_displayReconfiguration","(IZ)V");
JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration,
(jint) display, (jboolean) flags & kCGDisplayRemoveFlag);
+ (*env)->DeleteLocalRef(env, graphicsEnv);
});
}];
}