Mercurial > hg > release > icedtea-web-1.2
changeset 243:9cf54e1ace44
Backed out 0256de6a4bf6 as it is prone to race conditions.
author | Deepak Bhole <dbhole@redhat.com> |
---|---|
date | Fri, 27 May 2011 17:03:25 -0400 |
parents | cce92a1211ae |
children | c73d453f811b |
files | ChangeLog plugin/icedteanp/java/sun/applet/PluginAppletViewer.java |
diffstat | 2 files changed, 13 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri May 27 12:45:05 2011 -0400 +++ b/ChangeLog Fri May 27 17:03:25 2011 -0400 @@ -1,3 +1,7 @@ +2011-05-27 Deepak Bhole <dbhole@redhat.com> + + * Backed out 0256de6a4bf6 + 2011-05-27 Omair Majid <omajid@redhat.com> * NEWS: Update.
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri May 27 12:45:05 2011 -0400 +++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri May 27 17:03:25 2011 -0400 @@ -1621,26 +1621,15 @@ if (cl instanceof JNLPClassLoader.CodeBaseClassLoader) cl = ((JNLPClassLoader.CodeBaseClassLoader) cl).getParentJNLPClassLoader(); + ThreadGroup tg = ((JNLPClassLoader) cl).getApplication().getThreadGroup(); + appletShutdown(p); appletPanels.removeElement(p); - - /* TODO: Applets don't always shut down nicely. We - * need to find a proper way to forcibly closing all threads - * an applet starts during its lifetime - */ + dispose(); - try { - SwingUtilities.invokeAndWait(new Runnable() { - public void run() { - dispose(); - } - }); - } catch (Exception e) { // ignore, we are just disposing it - } + if (tg.activeCount() > 0) + tg.stop(); - // If there are no more applets running, exit the VM - // TODO: There is a possible race condition here as count - // can be 0 when an applet is in the initialization phase if (countApplets() == 0) { appletSystemExit(); } @@ -1651,10 +1640,12 @@ } /** - * This function should be called to halt the VM when all applets are destroyed. + * Exit the program. + * Exit from the program (if not stand alone) - do no clean-up */ private void appletSystemExit() { - System.exit(0); + // Do nothing. Exit is handled by another + // block of code, called when _all_ applets are gone } /**