7160623: [macosx] Editable TextArea/TextField are blocking GUI applications from exit

Reviewed-by: anthony, art
This commit is contained in:
Sergey Bylokhov 2012-05-03 18:29:00 +04:00
parent 4d0e923a60
commit 0705c62050
2 changed files with 13 additions and 1 deletions

View File

@ -372,7 +372,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
}
@Override
public void dispose() {
public final void dispose() {
if (disposed.compareAndSet(false, true)) {
disposeImpl();
}

View File

@ -81,6 +81,18 @@ abstract class LWTextComponentPeer<T extends TextComponent, D extends JComponent
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) {