From 1eea75f3fa48229c0505021d1453ef905042d4fa Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Wed, 4 Apr 2007 11:30:32 +0000 Subject: 2007-04-04 Roman Kennke * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c (init_glib_threads): Create global reference on lock object. --- ChangeLog | 5 +++++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0ec23e93..632c26c7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-04 Roman Kennke + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c + (init_glib_threads): Create global reference on lock object. + 2007-04-04 Roman Kennke * java/awt/Frame.java diff --git a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c index 5d73af4e6..d2a4b0e42 100644 --- a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c +++ b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c @@ -113,7 +113,7 @@ double cp_gtk_dpi_conversion_factor; static void jni_lock_cb(); static void jni_unlock_cb(); -static void init_glib_threads(jint, jobject); +static void init_glib_threads(JNIEnv*, jint, jobject); static gboolean post_set_running_flag (gpointer); static gboolean set_running_flag (gpointer); static gboolean clear_running_flag (gpointer); @@ -169,7 +169,7 @@ Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit (JNIEnv *env, argv[0][0] = '\0'; argv[1] = NULL; - init_glib_threads(portableNativeSync, lock); + init_glib_threads(env, portableNativeSync, lock); /* From GDK 2.0 onwards we have to explicitly call gdk_threads_init */ gdk_threads_init(); @@ -256,7 +256,7 @@ static void jni_unlock_cb() In some release following 0.10, that config.h macro will go away.) */ static void -init_glib_threads(jint portableNativeSync, jobject lock) +init_glib_threads(JNIEnv *env, jint portableNativeSync, jobject lock) { if (portableNativeSync < 0) { @@ -272,7 +272,7 @@ init_glib_threads(jint portableNativeSync, jobject lock) { if (portableNativeSync) { - global_lock = lock; + global_lock = (*env)->NewGlobalRef(env, lock); gdk_threads_set_lock_functions(&jni_lock_cb, &jni_unlock_cb); } g_thread_init(NULL); -- cgit v1.2.1