jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m
changeset 31158 062c7363dd12
parent 28238 0ae492c1def5
equal deleted inserted replaced
31157:25a62bb54efa 31158:062c7363dd12
   309 
   309 
   310     AWTStrike *awtStrike = (AWTStrike *)jlong_to_ptr(awtStrikePtr);
   310     AWTStrike *awtStrike = (AWTStrike *)jlong_to_ptr(awtStrikePtr);
   311 
   311 
   312     jlong *glyphInfos =
   312     jlong *glyphInfos =
   313         (*env)->GetPrimitiveArrayCritical(env, glyphInfoLongArray, NULL);
   313         (*env)->GetPrimitiveArrayCritical(env, glyphInfoLongArray, NULL);
   314     if (glyphInfos != NULL) {
   314 
   315         jint *rawGlyphCodes =
   315     jint *rawGlyphCodes =
   316             (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL);
   316             (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL);
   317 
   317     @try {
       
   318         if (rawGlyphCodes != NULL && glyphInfos != NULL) {
       
   319             CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike,
       
   320                     rawGlyphCodes, len);
       
   321         }
       
   322     }
       
   323     @finally {
   318         if (rawGlyphCodes != NULL) {
   324         if (rawGlyphCodes != NULL) {
   319             CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike,
       
   320                                             rawGlyphCodes, len);
       
   321 
       
   322             (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes,
   325             (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes,
   323                                               rawGlyphCodes, JNI_ABORT);
   326                                                   rawGlyphCodes, JNI_ABORT);
   324         }
   327         }
   325         // Do not use JNI_COMMIT, as that will not free the buffer copy
   328         if (glyphInfos != NULL) {
   326         // when +ProtectJavaHeap is on.
   329             // Do not use JNI_COMMIT, as that will not free the buffer copy
   327         (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray,
   330             // when +ProtectJavaHeap is on.
   328                                               glyphInfos, 0);
   331             (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray,
       
   332                                                   glyphInfos, 0);
       
   333         }
   329     }
   334     }
   330 
   335 
   331 JNF_COCOA_EXIT(env);
   336 JNF_COCOA_EXIT(env);
   332 }
   337 }
   333 
   338