JDK-2221043 : Memory leak in javax.swing.plaf.synth.SynthTreeUI
  • Type: Backport
  • Backport of: JDK-7143857
  • Component: client-libs
  • Sub-Component: javax.swing
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-02-09
  • Updated: 2013-04-22
  • Resolved: 2012-02-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u4Fixed 8 b27Fixed
Comments
EVALUATION The SynthTreeUI#paintContext field is initialized in the SynthTreeUI#paint method and used only while painting, so there is no need to keep it after painting. Moreover according javadoc of SynthContext: "A SynthContext should only be considered valid for the duration of the method it is passed to. In other words you should not cache a SynthContext that is passed to you and expect it to remain valid." Therefore that's a good reason to clear SynthTreeUI#paintContext after painting.
09-02-2012