diff options
author | Francis Kung <fkung@redhat.com> | 2007-04-17 20:15:53 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@gcc.gnu.org> | 2007-04-17 20:15:53 +0000 |
commit | abe2f66ab9f4840008c43a61596eebd42af7842b (patch) | |
tree | 2a9bf0482db315956df7cf772dc3988469964047 /libjava | |
parent | 5594a6c8c051051e68c1dad0feec273eac4aa5d0 (diff) | |
download | gcc-abe2f66ab9f4840008c43a61596eebd42af7842b.zip gcc-abe2f66ab9f4840008c43a61596eebd42af7842b.tar.gz gcc-abe2f66ab9f4840008c43a61596eebd42af7842b.tar.bz2 |
re PR awt/31311 (Quitting applet can hang X server)
2007-04-17 Francis Kung <fkung@redhat.com>
PR classpath/31311
* gnu/java/awt/peer/gtk/ComponentGraphics.java
(dispose): Removed method.
(disposeSurface): Removed method.
* gnu_java_awt_peer_gtk_ComponentGraphics.h: Regenerated.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c
(Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface): Removed.
(Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState): Destroy surface
after it is used to create a cairo context.
From-SVN: r123928
Diffstat (limited to 'libjava')
4 files changed, 15 insertions, 45 deletions
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog index c1c14a6..244b98d 100644 --- a/libjava/classpath/ChangeLog +++ b/libjava/classpath/ChangeLog @@ -1,3 +1,15 @@ +2007-04-17 Francis Kung <fkung@redhat.com> + + PR classpath/31311 + * gnu/java/awt/peer/gtk/ComponentGraphics.java + (dispose): Removed method. + (disposeSurface): Removed method. + * gnu_java_awt_peer_gtk_ComponentGraphics.h: Regenerated. + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c + (Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface): Removed. + (Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState): Destroy surface + after it is used to create a cairo context. + 2007-04-16 Tom Tromey <tromey@redhat.com> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=236614 diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java b/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java index 763ad7d..098052a 100644 --- a/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java +++ b/libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java @@ -139,21 +139,6 @@ public class ComponentGraphics extends CairoGraphics2D } /** - * Destroys the component surface and calls dispose on the cairo - * graphics2d to destroy any super class resources. - */ - public void dispose() - { - super.dispose(); - disposeSurface(nativePointer); - } - - /** - * Destroys the component surface. - */ - private native void disposeSurface(long nativePointer); - - /** * Creates a cairo_t for a volatile image */ protected native long initFromVolatile( long pixmapPtr, int width, int height); diff --git a/libjava/classpath/include/gnu_java_awt_peer_gtk_ComponentGraphics.h b/libjava/classpath/include/gnu_java_awt_peer_gtk_ComponentGraphics.h index fbd5f6a..2df1246 100644 --- a/libjava/classpath/include/gnu_java_awt_peer_gtk_ComponentGraphics.h +++ b/libjava/classpath/include/gnu_java_awt_peer_gtk_ComponentGraphics.h @@ -11,7 +11,6 @@ extern "C" #endif JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState (JNIEnv *env, jobject, jobject); -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface (JNIEnv *env, jobject, jlong); JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_initFromVolatile (JNIEnv *env, jobject, jlong, jint, jint); JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_start_1gdk_1drawing (JNIEnv *env, jobject); JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_end_1gdk_1drawing (JNIEnv *env, jobject); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c index 25163cd..ed9cf3d 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c @@ -1,5 +1,5 @@ /* gnu_java_awt_peer_gtk_ComponentGraphics.c - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -159,40 +159,13 @@ Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState cr = cairo_create (surface); g_assert(cr != NULL); + cairo_surface_destroy(surface); gdk_threads_leave(); return PTR_TO_JLONG(cr); } -/** - * Disposes of the surface - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface - (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), - jlong value) -{ - struct cairographics2d *gr; - cairo_surface_t *surface; - - gr = JLONG_TO_PTR(struct cairographics2d, value); - - if (gr == NULL) - return; - - if (gr->cr == NULL) - return; - - surface = cairo_get_target (gr->cr); - if (surface != NULL) - { - gdk_threads_enter(); - cairo_surface_destroy (surface); - gdk_threads_leave(); - } -} - JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_initFromVolatile (JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)), @@ -224,6 +197,7 @@ Java_gnu_java_awt_peer_gtk_ComponentGraphics_initFromVolatile cr = cairo_create (surface); g_assert(cr != NULL); + cairo_surface_destroy(surface); gdk_threads_leave(); |