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

Memory leak in work with JInternalFrame using WindowsDesktopManager

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0, 1.3.1
    • client-libs
    • beta
    • generic, x86
    • generic, windows_2000
    • Not verified



      Name: ssT124754 Date: 02/26/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)


      WindowsDesktopManager class keeps internal variable currentFrame
      to mark the frame that is currently selected.
      When I am closing the internal frame, the following code is executed:
      (WindowsDesktopManager.java:57)

       public void closeFrame(JInternalFrame f) {
              if (f == currentFrame) { activateNextFrame(); }
              childFrames.removeElement(f);
              super.closeFrame(f);
       }

      The problem occurs when I'm trying to close the only frame in the desktop.
      In this case when the desktop manager tries to activate the next frame
      the following occured:
      private void switchFrame(boolean next) {
                    ......
              int count = childFrames.size();
              if (count <= 1) {
                  // No other child frames.
                  return; //!!!!!!!BUG!!!!!!!!
              //It must be:
                  currentFrame = null;
                  return;

              }
      The desktop manager tries to activate next frame and (since there is
      no frame to activate) simply returns, leaving the currentFrame
      variable pointing to the frame being closed.
      This makes impossible to collect the frame in the garbage collection.

      The bug sounds very much like 4177795,
      but it is closed so I submit it as a new one.
      (Review ID: 117631)
      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            ssultanasunw Shaheen Sultana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: