Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8275723: Crash on macOS 12 in GlassRunnable::dealloc
Backport-of: 4d8e12d231476fe72742cf10c223d8baf5028677
  • Loading branch information
kevinrushforth committed Nov 5, 2021
1 parent d9c0729 commit 5f9d973
Showing 1 changed file with 5 additions and 14 deletions.
Expand Up @@ -98,30 +98,21 @@ - (void)run
{
assert(pthread_main_np() == 1);
JNIEnv *env = jEnv;
if (env != NULL)
if (env != NULL && self->jRunnable != NULL)
{
(*env)->CallVoidMethod(env, self->jRunnable, jRunnableRun);
GLASS_CHECK_EXCEPTION(env);

(*env)->DeleteGlobalRef(env, self->jRunnable);
}

self->jRunnable = NULL;

[self release];
}
[pool drain];
}

- (void)dealloc
{
assert(pthread_main_np() == 1);
JNIEnv *env = jEnv;
if (env != NULL)
{
(*env)->DeleteGlobalRef(env, self->jRunnable);
}
self->jRunnable = NULL;

[super dealloc];
}

@end

#pragma mark --- GlassApplication
Expand Down

1 comment on commit 5f9d973

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.