jdk/src/macosx/native/sun/awt/AWTView.m
changeset 12660 76c54631149e
parent 12659 fa378682b3cb
child 13007 f6bf3300b455
--- a/jdk/src/macosx/native/sun/awt/AWTView.m	Thu May 17 21:27:19 2012 +0400
+++ b/jdk/src/macosx/native/sun/awt/AWTView.m	Thu May 17 21:31:55 2012 +0400
@@ -393,12 +393,13 @@
 }
 
 -(void) deliverJavaKeyEventHelper: (NSEvent *) event {
-    static id sUnretainedLastKeyEvent = nil;    
-    if (event == sUnretainedLastKeyEvent) {
+    static NSEvent* sLastKeyEvent = nil;
+    if (event == sLastKeyEvent) {
         // The event is repeatedly delivered by keyDown: after performKeyEquivalent:
         return;
     }
-    sUnretainedLastKeyEvent = event;	
+    [sLastKeyEvent release];
+    sLastKeyEvent = [event retain];
 	
     [AWTToolkit eventCountPlusPlus];
     JNIEnv *env = [ThreadUtilities getJNIEnv];