changeset 5350:c31eeeda3ed1

7160623: [macosx] Editable TextArea/TextField are blocking GUI applications from exit Reviewed-by: anthony, art
author serb
date Thu, 03 May 2012 18:29:00 +0400
parents 0fad89bd606b
children a420895ee2c3
files src/macosx/classes/sun/lwawt/LWComponentPeer.java src/macosx/classes/sun/lwawt/LWTextComponentPeer.java
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Wed May 02 17:54:18 2012 +0400
+++ b/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/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java	Wed May 02 17:54:18 2012 +0400
+++ b/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) {