changeset 236:a28b81cac144

Call dispose() from swing thread when applet is closed. Do not stop applet threadgroup on exit.
author Deepak Bhole <dbhole@redhat.com>
date Fri, 27 May 2011 17:27:55 -0400
parents df4d263c8015
children d9d787e8ce3e
files ChangeLog plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 27 17:03:25 2011 -0400
+++ b/ChangeLog	Fri May 27 17:27:55 2011 -0400
@@ -1,3 +1,9 @@
+2011-05-27  Deepak Bhole <dbhole@redhat.com>
+
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+	(appletClose): Call dispose from the swing thread. Also, don't try to stop
+	the threadgroup.
+
 2011-05-27  Deepak Bhole <dbhole@redhat.com>
 
 	* Backed out 0256de6a4bf6
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Fri May 27 17:03:25 2011 -0400
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Fri May 27 17:27:55 2011 -0400
@@ -1609,10 +1609,15 @@
 
                 appletShutdown(p);
                 appletPanels.removeElement(p);
-                dispose();
 
-                if (tg.activeCount() > 0)
-                    tg.stop();
+                try {
+                    SwingUtilities.invokeAndWait(new Runnable() {
+                        public void run() {
+                            dispose();
+                        }
+                    });
+                } catch (Exception e) { // ignore, we are just disposing it
+                }
 
                 if (countApplets() == 0) {
                     appletSystemExit();