Hi All,

Please review a fix for an memory leak issue whereby the BasicComboBoxUI uses a CellRenderer pane to paint the renderer component retrieved via getListCellRenderer from the JList instance. CellRendererPane paint the component but it never removes it from its component hierarchy. JCombobox can produce dynamic renderer component instances in getListCellRenderer method. Each one of these instances will linger in memory because it remains in the component hierarchy of the CellRendererPane resulting in memory leak.

This is solved for JList in JDK-5044798 <https://bugs.openjdk.java.net/browse/JDK-5044798>.

The fix is now extended for BasicComboBoxUI where removeAll() of components is done after all painting is done.

The JDK-5044798 <https://bugs.openjdk.java.net/browse/JDK-5044798> regression testcase is used for JComboBox with all L&Fs and other *ComboBoxUIs are fixed similarly.

Bug: https://bugs.openjdk.java.net/browse/JDK-6542439

webrev: http://cr.openjdk.java.net/~psadhukhan/6542439/webrev.0/

Regards
Prasanta

Reply via email to