Skip to content

Commit

Permalink
JBR-2207 TitledBorder leaks PropertyChangeListener
Browse files Browse the repository at this point in the history
Added a separate pass with sending setVisible(false) to the frames holding TitledBorder references in order to get WINDOW_DEACTIVATED (to clear KeyBoardFocusManager.activeWindow field)
  • Loading branch information
avu committed Jun 16, 2021
1 parent a56060d commit 3b03c69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/jdk/javax/swing/border/TestTitledBorderLeak.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public static void main(String[] args) throws Exception {
System.err.println("TOTAL_TITLEDBORDER != weakRefArrTB.size()");
}
Thread.sleep(3000);
SwingUtilities.invokeAndWait(() -> {
for (int i = 0; i < TOTAL_TITLEDBORDER; i++) {
frame[i].setVisible(false);
}
});
Thread.sleep(3000);
SwingUtilities.invokeAndWait(() -> {
for (int i = 0; i < TOTAL_TITLEDBORDER; i++) {
frame[i].dispose();
Expand Down

0 comments on commit 3b03c69

Please sign in to comment.