> This PR automatically calls CAccessible.dispose() as Components are removed > from the AWT hierarchy. > > I don't have a great understanding of this area of code / subject matter, but > this appears to resolve #8381236. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
Jeremy Wood has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 14 additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into 8381236 - Merge branch 'master' into 8381236 - 8381236: refactor proposed solution I still don't understand the life cycle of a CAccessible, but I'm starting to think this simpler approach may be better. It seems like: A. We never discard a CAccessible. Once CAccessible 'Y' is constructed, it will forever be paired with (and referenced by) its AccessibleContext 'X'. (Therefore the listeners that 'Y' installs never need to be uninstalled.) B. Some external entity is defining `CAccessible#ptr`. We don't receive a call to `setPtr`, and it's not defined during construction. But at some point as VoiceOver interacts with a Swing app the `ptr` field is defined. C. It appears safe to call `dispose()` repeatedly on the same CAccessible. So in this way `dispose()` is like `Window.dispose()`: it releases resources, but it can be reallocated later (by some external agent). (By contrast it is NOT like `Graphics2D.dispose()`; subsequent attempts to use a Graphics2D will fail after it has been disposed.) - 8381236: updating propertyChange vars This is in response to: https://github.com/openjdk/jdk/pull/30578/changes#r3120285255 - Merge branch 'master' into 8381236 - 8381236: fixing whitespace - 8381236: remove AXChangeNotifier after dispose This PR really focuses on controlling the lifecycle of a CAccessible, so if we're encouraging them to be disposed more often: we should also uninstall our listeners. - 8381236: tweak comment - 8381236: make new method private - 8381236: remove unused import - ... and 4 more: https://git.openjdk.org/jdk/compare/362d9450...1f220ca1 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/30578/files - new: https://git.openjdk.org/jdk/pull/30578/files/c0b0f477..1f220ca1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=30578&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30578&range=03-04 Stats: 62413 lines in 577 files changed: 7196 ins; 53559 del; 1658 mod Patch: https://git.openjdk.org/jdk/pull/30578.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/30578/head:pull/30578 PR: https://git.openjdk.org/jdk/pull/30578
