mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-26 12:23:59 +08:00
gnu_java_awt_peer_gtk_GdkPixbufDecoder.c: use DeleteLocalRef() to avoid exhausting local native references.
2005-05-06 Archie Cobbs <archie@dellroad.org> * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c: use DeleteLocalRef() to avoid exhausting local native references. From-SVN: r99302
This commit is contained in:
parent
9b8d7b4252
commit
8108f99852
@ -1,3 +1,8 @@
|
||||
2005-05-06 Archie Cobbs <archie@dellroad.org>
|
||||
|
||||
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:
|
||||
use DeleteLocalRef() to avoid exhausting local native references.
|
||||
|
||||
2005-05-06 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
|
||||
|
@ -206,6 +206,7 @@ query_formats (JNIEnv *env, jclass clazz)
|
||||
jclass formatClass;
|
||||
jmethodID addExtensionID;
|
||||
jmethodID addMimeTypeID;
|
||||
jobject string;
|
||||
|
||||
formatClass = (*env)->FindClass
|
||||
(env, "gnu/java/awt/peer/gtk/GdkPixbufDecoder$ImageFormatSpec");
|
||||
@ -227,26 +228,33 @@ query_formats (JNIEnv *env, jclass clazz)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user