classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Re: FYI: GtkSelection.c LocalRef cleanup


From: Mark Wielaard
Subject: [cp-patches] Re: FYI: GtkSelection.c LocalRef cleanup
Date: Tue, 29 Nov 2005 14:10:49 +0100

Hi Christian,

On Sat, 2005-11-26 at 14:19 +0100, Christian Thalinger wrote:
> Nice, but you missed some local refs.  And the bug's not fixed :-)
> These are some more i've found, but there is still something left.  The
> line where it's out of local refs is:
> 
> #2  0x00002aaaab4f5c01 in clipboard_targets_received (clipboard=Variable
> "clipboard" is not available.
> ) at gnu_java_awt_peer_gtk_GtkSelection.c:106
>
> But i don't know where it actually leaks the refs.  Maybe someone else?

I added a note to the bug. Will look into this.

> 2005-11-26  Christian Thalinger  <address@hidden>
> 
>       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c 
>       (clipboard_get_func): Added missing DeleteLocalRef calls.
>       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c 
>       (clipboard_targets_received): Likewise.
>       (clipboard_uris_received): Likewise.

Right, I forgot about GtkClipboard. Thanks.
The string class references are a bit annoying. Maybe we should just
have a simple global pool of references to some of the basic classes
like String, Object, Class, ClassLoader, etc. that can be used by all
JNI code.

> @@ -133,6 +135,8 @@ clipboard_targets_received (GtkClipboard
>                       (*env)->DeleteLocalRef (env, string);
>                     }
>                 }
> +
> +             (*env)->DeleteLocalRef(env, strings);
>             }

This doesn't look correct. We are going to use strings for calling a
method a little bit later.

> @@ -331,6 +337,8 @@ clipboard_uris_received (GtkClipboard *c
>               (*env)->SetObjectArrayElement (env, strings, i, string);
>               (*env)->DeleteLocalRef (env, string);
>             }
> +
> +         (*env)->DeleteLocalRef(env, strings);
>         }
>        g_strfreev (uris);
>      }

Likewise for this spot.

Cheers,

Mark





reply via email to

[Prev in Thread] Current Thread [Next in Thread]