1. flamingo
  2. FLAMINGO-59

Allow JRibbonFrames to be garbage collected after disposal


    • Type: Improvement Improvement
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: milestone 1
    • Component/s: ribbon
    • Labels:
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:


      JRibbonFrame registers several listeners with the AWT Toolkit that are not
      removed when the window is disposed(). The culprits are the AWTEventListener
      and KeyTipManager.KeyTipListener registered in initRibbonFrame().

      If we open up a JRibbonFrame and then close it, all resources associated with
      that frame are held onto as it cannot be garbage collected due to these
      listeners. This makes a pattern where we construct and show JRibbonFrames on
      demand, and then destroy them when they are closed difficult due to the
      resulting memory leak.

      Since JRibbonFrame is the only supported way of accessing the Ribbon, it is very
      hard to work around this. For the AWTEventListener you can work out which
      listener the constructor added in a subclass and hold on to a reference to it to
      remove it when the frame is closed, but for the key tip listener, there is no
      way to view the current listener list and grab the last entry. We could
      probably work around this if the KeyTipManager had a public method to return all
      listeners--if the larger issue is more difficult to fix in the short term, the
      addition of a getKeyTipListeners() method would likely enable a workaround.

      These references were from tracing down what was referencing the JRibbonFrame in
      the NetBeans heap walker.



          • Assignee:
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: