changeset 5029:7647f9201e31

7160623: [macosx] Editable TextArea/TextField are blocking GUI applications from exit Reviewed-by: anthony, kizune
author serb
date Thu, 24 May 2012 17:17:58 +0400
parents 5bf0eb7c560c
children 665d7e1e7252 61517f1fe79e
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	Thu Mar 08 14:04:44 2012 +0000
+++ b/src/macosx/classes/sun/lwawt/LWComponentPeer.java	Thu May 24 17:17:58 2012 +0400
@@ -377,7 +377,7 @@
     }
 
     @Override
-    public void dispose() {
+    public final void dispose() {
         if (disposed.compareAndSet(false, true)) {
             disposeImpl();
         }
--- a/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java	Thu Mar 08 14:04:44 2012 +0000
+++ b/src/macosx/classes/sun/lwawt/LWTextComponentPeer.java	Thu May 24 17:17:58 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) {