diff options
author | Anton Tarasov <anton.tarasov@jetbrains.com> | 2017-07-12 13:32:35 +0300 |
---|---|---|
committer | Anton Tarasov <anton.tarasov@jetbrains.com> | 2017-07-12 13:33:15 +0300 |
commit | 5863e266de7047517c48d5390c9fec12f6836dc7 (patch) | |
tree | 4d268bc14f060403bdd3f829af97e75a3121a7a4 /src/macosx | |
parent | 7558fc02336f6d6111574aacd68b5ec6fa5e9253 (diff) | |
download | jdk8u_jdk-5863e266de7047517c48d5390c9fec12f6836dc7.tar.gz |
JRE-422 AWTView deliverJavaMouseEvent leaks jEventjb8u152-b943
Diffstat (limited to 'src/macosx')
-rw-r--r-- | src/macosx/native/sun/awt/AWTView.m | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/macosx/native/sun/awt/AWTView.m b/src/macosx/native/sun/awt/AWTView.m index 5a0209b3f0..8d2aaa83fe 100644 --- a/src/macosx/native/sun/awt/AWTView.m +++ b/src/macosx/native/sun/awt/AWTView.m @@ -448,20 +448,6 @@ static const int COCOA_KEYCODE_US_BACKSLASH = 44; deltaY = [event scrollingDeltaY] * 0.1; } - static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent"); - static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IIIIIIIIDDI)V"); - jobject jEvent = JNFNewObject(env, jctor_NSEvent, - [event type], - [event modifierFlags], - clickCount, - [event buttonNumber], - (jint)localPoint.x, (jint)localPoint.y, - (jint)absP.x, (jint)absP.y, - deltaY, - deltaX, - [AWTToolkit scrollStateWithEvent: event]); - CHECK_NULL(jEvent); - AWTWindow *awtWindow = (AWTWindow*)[event window]; if (![AWTWindow isAWTWindow: awtWindow]) { @@ -479,6 +465,19 @@ static const int COCOA_KEYCODE_US_BACKSLASH = 44; } static JNF_CLASS_CACHE(jc_PlatformWindow, "sun/lwawt/macosx/CPlatformWindow"); + static JNF_CLASS_CACHE(jc_NSEvent, "sun/lwawt/macosx/NSEvent"); + static JNF_CTOR_CACHE(jctor_NSEvent, jc_NSEvent, "(IIIIIIIIDDI)V"); + jobject jEvent = JNFNewObject(env, jctor_NSEvent, + [event type], + [event modifierFlags], + clickCount, + [event buttonNumber], + (jint)localPoint.x, (jint)localPoint.y, + (jint)absP.x, (jint)absP.y, + deltaY, + deltaX, + [AWTToolkit scrollStateWithEvent: event]); + CHECK_NULL(jEvent); if (!JNFIsInstanceOf(env, platformWindow, &jc_PlatformWindow)) { NSLog(@"Platform window is not an instance of CPlatformWindow"); @@ -494,6 +493,7 @@ static const int COCOA_KEYCODE_US_BACKSLASH = 44; } else { NSLog(@"m_cPlatformView is null"); } + (*env)->DeleteLocalRef(env, jEvent); (*env)->DeleteLocalRef(env, platformWindow); } |