Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252597

[macos] awt_CreateEmbeddedFrame incorrectly caches a local reference

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, 11, 14, 15, 16
    • client-libs

      The macOS implementation of awt_CreateEmbeddedFrame incorrectly caches a local reference to the embedded frame class, resulting in a crash if invoked a second time.

      JNIEXPORT jobject JNICALL awt_CreateEmbeddedFrame
      (JNIEnv* env, void* platformInfo)
      {
          static jmethodID mid = NULL;
          static jclass cls;
          if (mid == NULL) {
              cls = (*env)->FindClass(env, embeddedClassName);
              CHECK_NULL_RETURN(cls, NULL);
              mid = (*env)->GetMethodID(env, cls, "<init>", "(J)V");
              CHECK_NULL_RETURN(mid, NULL);
          }
          return (*env)->NewObject(env, cls, mid, platformInfo);
      }

            Unassigned Unassigned
            alans Alan Snyder
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: