JDK-8207373 : Need to dispose native Robot objects to avoid resource leak
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: openjfx11
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2018-07-17
  • Updated: 2020-01-06
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
The GlassRobot object has a destroy method, but there is no code that actually calls it. In order to avoid a native leak we should call destroy via a disposer mechanism (since it may be needed to clean up native resources).

Comments
Need some guidance on how to proceed on this issue: I see that there are currently multiple disposers implemented in the codebase. For example: com.sun.javafx.embed.swing.Disposer using thread name "SwingNode Disposer" com.sun.javafx.font.Disposer using thread name "Prism Font Disposer" com.sun.javafx.property.adapter.Disposer using thread name "Property Disposer" com.sun.webkit.Disposer using thread name "Disposer" com.sun.prism.impl.Disposer (runs on JavaFX application thread IIUC) My plan is to add the disposer record in `GlassRobot.java`, when a Robot is instantiated, which calls the destroy method. My question is, should I use one of the available disposers (even though none of them really fit in name), at least the one's that are visible to GlassRobot (com.sun.javafx.font.Disposer, com.sun.prism.impl, and com.sun.javafx.property.adapter.Disposer) or create a new Disposer specifically for robots with thread name "Robot Disposer", for example.
25-09-2018