7160623: [macosx] Editable TextArea/TextField are blocking GUI applications from exit
Reviewed-by: anthony, art
--- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java Wed May 02 17:54:18 2012 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java Thu May 03 18:29:00 2012 +0400
@@ -372,7 +372,7 @@
}
@Override
- public void dispose() {
+ public final void dispose() {
if (disposed.compareAndSet(false, true)) {
disposeImpl();
}
--- a/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java Wed May 02 17:54:18 2012 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java Thu May 03 18:29:00 2012 +0400
@@ -81,6 +81,18 @@
firstChangeSkipped = true;
}
+ @Override
+ protected final void disposeImpl() {
+ synchronized (getDelegateLock()) {
+ // visible caret has a timer thread which must be stopped
+ getTextComponent().getCaret().setVisible(false);
+ }
+ super.disposeImpl();
+ }
+
+ /**
+ * This method should be called under getDelegateLock().
+ */
abstract JTextComponent getTextComponent();
public Dimension getPreferredSize(final int rows, final int columns) {