RFR: 8262518: SwingNode.setContent does not close previous content, resulting in memory leak [v4]

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Aug 24 03:17:03 UTC 2023


> Issue is when setting the content of a SwingNode, the old content is not garbage collected owing to the fact
> JLightweightFrame is never being released by SwingNodeDisposer
> 
> The SwingNodeDisposer holds an hard pointer to the JLightweightFrame that prevents its collection
> 
> Modified `SwingNode.setContentImpl`  function to use a WeakReference to properly release the memory.

Prasanta Sadhukhan has updated the pull request incrementally with two additional commits since the last revision:

 - javadoc, null check
 - javadoc, null check

-------------

Changes:
  - all: https://git.openjdk.org/jfx/pull/1219/files
  - new: https://git.openjdk.org/jfx/pull/1219/files/a388e83a..7a282e15

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=1219&range=03
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=1219&range=02-03

  Stats: 14 lines in 3 files changed: 9 ins; 2 del; 3 mod
  Patch: https://git.openjdk.org/jfx/pull/1219.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1219/head:pull/1219

PR: https://git.openjdk.org/jfx/pull/1219


More information about the openjfx-dev mailing list