Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4229318

internal references prevent JInternalFrames from being GC'd

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 1.1.7, 1.2.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      solaris_10, windows_95

      Description

      web bug from ###@###.###:

      The problem is that JInternalFrames cannot get garbage collected
      when they're killed through their "close" button. This is because
      the button is the last thing to have focus. Run the following
      program w/ a heap inspector. You will see that even after you
      close one of the internal frames and garbage collect, 2 instances
      remain; however, if you close one and then, say, maximize the
      other and THEN garbage collect, the first one will go away.

      import com.sun.java.swing.*;

      public class InternalFrameBug {
        public static void main(String[] args)
        {
          JFrame frame = new JFrame();
          JDesktopPane desktop = new JDesktopPane();
          frame.getContentPane().add(desktop,"Center");
          
          JInternalFrame intF = new JInternalFrame("Bug!",true,true,true,true);
          intF.setSize(100,100);
          desktop.add(intF);
          intF.setVisible(true);

          JInternalFrame oneMore = new JInternalFrame("goo",true,true,true,true);
          oneMore.setSize(100,100);
          oneMore.setLocation(20,20);
          desktop.add(oneMore);
          oneMore.setVisible(true);

          frame.setSize(300,300);
          frame.setVisible(true);
        }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hgajewsksunw Hania Gajewska (Inactive)
              Reporter:
              amfowler Anne Fowler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: