|
Re: Bug in java_nio_VMDirectByteBuffer.c: msg#00129java.classpath.patches
Archie Cobbs wrote: In gnu_java_awt_peer_gtk_GdkPixbufDecoder.c, in the function OK, I'm fixing this one too (see attached patch). -Archie __________________________________________________________________________ Archie Cobbs * CTO, Awarix * http://www.awarix.com --- /home/archie/classpath/cvs/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c Fri Jan 21 09:16:23 2005 +++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c Wed Mar 16 09:18:18 2005 @@ -206,6 +206,7 @@ jclass formatClass; jmethodID addExtensionID; jmethodID addMimeTypeID; + jobject string; formatClass = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec"); @@ -227,26 +228,33 @@ format = (GdkPixbufFormat *) f->data; name = gdk_pixbuf_format_get_name(format); + string = (*env)->NewStringUTF(env, name); + g_assert(string != NULL); + jformat = (*env)->CallStaticObjectMethod - (env, clazz, registerFormatID, - (*env)->NewStringUTF(env, name), + (env, clazz, registerFormatID, string, (jboolean) gdk_pixbuf_format_is_writable(format)); + (*env)->DeleteLocalRef(env, string); g_assert(jformat != NULL); ch = gdk_pixbuf_format_get_extensions(format); while (*ch) { - (*env)->CallVoidMethod (env, jformat, addExtensionID, - (*env)->NewStringUTF(env, *ch)); + string = (*env)->NewStringUTF(env, *ch); + g_assert(string != NULL); + (*env)->CallVoidMethod (env, jformat, addExtensionID, string); + (*env)->DeleteLocalRef(env, string); ++ch; } ch = gdk_pixbuf_format_get_mime_types(format); while (*ch) { - (*env)->CallVoidMethod (env, jformat, addMimeTypeID, - (*env)->NewStringUTF(env, *ch)); + string = (*env)->NewStringUTF(env, *ch); + g_assert(string != NULL); + (*env)->CallVoidMethod (env, jformat, addMimeTypeID, string); + (*env)->DeleteLocalRef(env, string); ++ch; } } _______________________________________________ Classpath-patches mailing list Classpath-patches@xxxxxxx http://lists.gnu.org/mailman/listinfo/classpath-patches
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Bug in java_nio_VMDirectByteBuffer.c, Archie Cobbs |
|---|---|
| Next by Date: | FYI: Fix for the use of the reserved enum keyword in gnu.html, Andrew John Hughes |
| Previous by Thread: | Re: Bug in java_nio_VMDirectByteBuffer.c, Archie Cobbs |
| Next by Thread: | FYI: Fix for the use of the reserved enum keyword in gnu.html, Andrew John Hughes |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |