classpath-patches
[Top][All Lists]
Advanced

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

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


From: Mark Wielaard
Subject: [cp-patches] FYI: GtkSelection.c LocalRef cleanup
Date: Fri, 25 Nov 2005 21:17:16 +0100

Hi,

This should fix a bug Christian reported by cleaning up LocalRefs after
they have been used.

2005-11-25  Mark Wielaard  <address@hidden>

       Fixes bug #24981
       * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c
       (clipboard_targets_received): DeleteLocalRef of NewStringUTF.
       (clipboard_text_received): Likewise.
       (clipboard_uris_received): Likewise.

Christian, together with the patch that I committed today for this file
this should now compile warning free and actually work, even on 64bit
machines. Could you check?

Thanks,

Mark
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c,v
retrieving revision 1.2
diff -u -r1.2 gnu_java_awt_peer_gtk_GtkSelection.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c    3 Sep 2005 
23:43:12 -0000       1.2
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c    25 Nov 2005 
20:16:38 -0000
@@ -130,6 +130,7 @@
                        break;
                      (*env)->SetObjectArrayElement (env, strings, i++,
                                                     string);
+                     (*env)->DeleteLocalRef (env, string);
                    }
                }
            }
@@ -201,6 +202,10 @@
                           textAvailableID,
                           string);
   (*env)->DeleteGlobalRef (env, selection_obj);
+
+  if (string != NULL)
+    (*env)->DeleteLocalRef (env, string);
+
 }
 
 JNIEXPORT void JNICALL
@@ -324,6 +329,7 @@
              if (string == NULL)
                break;
              (*env)->SetObjectArrayElement (env, strings, i, string);
+             (*env)->DeleteLocalRef (env, string);
            }
        }
       g_strfreev (uris);

reply via email to

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