Skip to content
Permalink
Browse files
8274056: JavaAccessibilityUtilities leaks JNI objects
Reviewed-by: aivanov, ant
  • Loading branch information
savoptik authored and Anton Tarasov committed Sep 21, 2021
1 parent 57df0db commit 42d5d2abaad8a88a5e1326ea8b4494aeb8b5748b
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m
@@ -57,11 +57,14 @@ NSSize getAxComponentSize(JNIEnv *env, jobject axComponent, jobject component)
DECLARE_STATIC_METHOD_RETURN(jm_getSize, sjc_CAccessibility, "getSize",
"(Ljavax/accessibility/AccessibleComponent;Ljava/awt/Component;)Ljava/awt/Dimension;", NSZeroSize);

jobject dimension = (*env)->CallStaticObjectMethod(env, jc_Dimension, jm_getSize, axComponent, component);
jobject dimension = (*env)->CallStaticObjectMethod(env, sjc_CAccessibility, jm_getSize, axComponent, component);
CHECK_EXCEPTION();

if (dimension == NULL) return NSZeroSize;
return NSMakeSize((*env)->GetIntField(env, dimension, jf_width), (*env)->GetIntField(env, dimension, jf_height));

NSSize size = NSMakeSize((*env)->GetIntField(env, dimension, jf_width), (*env)->GetIntField(env, dimension, jf_height));
(*env)->DeleteLocalRef(env, dimension);
return size;
}

NSString *getJavaRole(JNIEnv *env, jobject axComponent, jobject component)
@@ -226,7 +229,9 @@ NSPoint getAxComponentLocationOnScreen(JNIEnv *env, jobject axComponent, jobject
axComponent, component);
CHECK_EXCEPTION();
if (jpoint == NULL) return NSZeroPoint;
return NSMakePoint((*env)->GetIntField(env, jpoint, sjf_X), (*env)->GetIntField(env, jpoint, sjf_Y));
NSPoint p = NSMakePoint((*env)->GetIntField(env, jpoint, sjf_X), (*env)->GetIntField(env, jpoint, sjf_Y));
(*env)->DeleteLocalRef(env, jpoint);
return p;
}

jint getAxTextCharCount(JNIEnv *env, jobject axText, jobject component)

7 comments on commit 42d5d2a

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot replied Sep 21, 2021

@TheRealMDoerr

This comment has been minimized.

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr replied Sep 28, 2021

/backport jdk11u-dev

@openjdk

This comment has been minimized.

Copy link

@openjdk openjdk bot replied Sep 28, 2021

@TheRealMDoerr the backport was successfully created on the branch TheRealMDoerr-backport-42d5d2ab in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 42d5d2ab from the openjdk/jdk repository.

The commit being backported was authored by Artem Semenov on 21 Sep 2021 and was reviewed by Alexey Ivanov and Anton Tarasov.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev TheRealMDoerr-backport-42d5d2ab:TheRealMDoerr-backport-42d5d2ab
$ git checkout TheRealMDoerr-backport-42d5d2ab
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev TheRealMDoerr-backport-42d5d2ab
@VladimirKempik

This comment has been minimized.

Copy link

@VladimirKempik VladimirKempik replied Sep 29, 2021

/backport jdk15u-dev

@VladimirKempik

This comment has been minimized.

Copy link

@VladimirKempik VladimirKempik replied Sep 29, 2021

/backport jdk13u-dev

@openjdk

This comment has been minimized.

Copy link

@openjdk openjdk bot replied Sep 29, 2021

@VladimirKempik the backport was successfully created on the branch VladimirKempik-backport-42d5d2ab in my personal fork of openjdk/jdk15u-dev. To create a pull request with this backport targeting openjdk/jdk15u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 42d5d2ab from the openjdk/jdk repository.

The commit being backported was authored by Artem Semenov on 21 Sep 2021 and was reviewed by Alexey Ivanov and Anton Tarasov.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk15u-dev:

$ git fetch https://github.com/openjdk-bots/jdk15u-dev VladimirKempik-backport-42d5d2ab:VladimirKempik-backport-42d5d2ab
$ git checkout VladimirKempik-backport-42d5d2ab
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk15u-dev VladimirKempik-backport-42d5d2ab
@openjdk

This comment has been minimized.

Copy link

@openjdk openjdk bot replied Sep 29, 2021

@VladimirKempik the backport was successfully created on the branch VladimirKempik-backport-42d5d2ab in my personal fork of openjdk/jdk13u-dev. To create a pull request with this backport targeting openjdk/jdk13u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit 42d5d2ab from the openjdk/jdk repository.

The commit being backported was authored by Artem Semenov on 21 Sep 2021 and was reviewed by Alexey Ivanov and Anton Tarasov.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk13u-dev:

$ git fetch https://github.com/openjdk-bots/jdk13u-dev VladimirKempik-backport-42d5d2ab:VladimirKempik-backport-42d5d2ab
$ git checkout VladimirKempik-backport-42d5d2ab
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk13u-dev VladimirKempik-backport-42d5d2ab
Please sign in to comment.