Package: jclic
Version: 0.2.1.0-1
Severity: important
Tags: patch
--- Please enter the report below this line. ---
JClic doesn't react to File->Close, Ctrl-X or the close button.
Launching JClic from a terminal I can see the following error:
Exception in thread "AWT-EventQueue-2" java.lang.IllegalStateException: line
already closed
at
org.classpath.icedtea.pulseaudio.PulseAudioClip.close(PulseAudioClip.java:241)
at edu.xtec.jclic.media.JavaSoundAudioPlayer.close(Unknown Source)
at edu.xtec.jclic.media.EventSoundsElement.close(Unknown Source)
at edu.xtec.jclic.media.EventSounds.close(Unknown Source)
at edu.xtec.jclic.Player.end(Unknown Source)
at edu.xtec.jclic.SingleInstanceJFrame$2.windowClosing(Unknown Source)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:349)
at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:349)
at java.awt.Window.processWindowEvent(Window.java:1974)
at javax.swing.JFrame.processWindowEvent(JFrame.java:290)
at java.awt.Window.processEvent(Window.java:1932)
at java.awt.Component.dispatchEventImpl(Component.java:4649)
at java.awt.Container.dispatchEventImpl(Container.java:2103)
at java.awt.Window.dispatchEventImpl(Window.java:2587)
at java.awt.Component.dispatchEvent(Component.java:4475)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:675)
at java.awt.EventQueue.access$300(EventQueue.java:96)
at java.awt.EventQueue$2.run(EventQueue.java:634)
at java.awt.EventQueue$2.run(EventQueue.java:632)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:108)
at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:119)
at java.awt.EventQueue$3.run(EventQueue.java:648)
at java.awt.EventQueue$3.run(EventQueue.java:646)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:108)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:645)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
It can be solved catching the exception throwed at:
org.classpath.icedtea.pulseaudio.PulseAudioClip.close()
The attached patch solves the issue altough I don't know if there is a more
elegant solution.
--- System information. ---
Architecture: i386
Kernel: Linux 3.2.0-4-686-pae
Debian Release: 7.1
500 wheezy linux.dropbox.com
500 stable security.debian.org
500 stable repo.lihuen.linti.unlp.edu.ar
500 stable ftp.nz.debian.org
500 stable dl.google.com
500 proposed-updates ftp.nz.debian.org
--- Package information. ---
Depends (Version) | Installed
============================-+-===========
openjdk-6-jre | 6b27-1.12.6-1~deb7u1
OR java6-runtime |
Recommends (Version) | Installed
============================-+-===========
libmysql-java | 5.1.16-2
iceweasel | 17.0.8esr-1~deb7u1
Suggests (Version) | Installed
========================================-+-===========
ttf-liberation | 1.07.2-6
OR ttf-mscorefonts-installer |
--- jclic-0.2.1.0.orig/src/core/edu/xtec/jclic/media/JavaSoundAudioPlayer.java
+++ jclic-0.2.1.0/src/core/edu/xtec/jclic/media/JavaSoundAudioPlayer.java
@@ -164,7 +164,11 @@ public class JavaSoundAudioPlayer implem
public void close(){
if(clip!=null){
- clip.close();
+ try {
+ clip.close();
+ } catch (Exception ex) {
+ System.out.println("Closing clip:\n" + ex);
+ }
clip=null;
}
ais=null;