bug-classpath
[Top][All Lists]
Advanced

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

[Bug awt/32518] New: memory leak in awt jni code(gnu_java_awt_peer_gtk_G


From: kyle at apogee dot com
Subject: [Bug awt/32518] New: memory leak in awt jni code(gnu_java_awt_peer_gtk_GtkComponentPeer.c)
Date: 26 Jun 2007 22:01:36 -0000

There is a memory leak in
Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetParent() of
native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c.

In the following code of the function mentioned above,


      GList *children = gtk_container_get_children
        (GTK_CONTAINER (parent_widget));

          if (GTK_IS_MENU_BAR (children->data))
            gtk_fixed_put (GTK_FIXED (children->next->data), widget, 0, 0);
          else
            gtk_fixed_put (GTK_FIXED (children->data), widget, 0, 0);


'children' is not freed and this causes memory leak.

This is fix. g_list_free(children) is added as below to free 'children'.

      GList *children = gtk_container_get_children
        (GTK_CONTAINER (parent_widget));

          if (GTK_IS_MENU_BAR (children->data))
            gtk_fixed_put (GTK_FIXED (children->next->data), widget, 0, 0);
          else
            gtk_fixed_put (GTK_FIXED (children->data), widget, 0, 0);
      g_list_free(children);


-- 
           Summary: memory leak in awt jni
                    code(gnu_java_awt_peer_gtk_GtkComponentPeer.c)
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: awt
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kyle at apogee dot com
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: arm-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32518





reply via email to

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