When running a Glass application on Mac, if one selects the menu item
java -> Quit Glass Application
or uses the Command-Q keyboard shortcut, the exceptions are thrown for both the ES2 and J2D pipelines and Java crashes for the J2D pipeline. This was observed for both apps/internal/MediaPlayer and apps/internal/WebMap so it is not a Media issue.
1. MediaPlayer
1.1 ES2
$ java -Djava.library.path=$JAVAFX_HOME/bin -classpath dist/diaPlayer.jar:/Users/bpb/Work/presidio-scrum-media/artifacts/sdk/rt/lib/jfxrt.jar com.javafx.experiments.mediaplayer.MediaPlayer
onPlaying
Java has been detached already, but someone is still trying to use it at -[GlassRunnable run]:/HUDSON/workspace/presidio/label/macosx-universal-14/glass/glass-mat-lib-macosx/src/com/sun/mat/ui/GlassApplication.m:151
Java has been detached already, but someone is still trying to use it at -[GlassRunnable dealloc]:/HUDSON/workspace/presidio/label/macosx-universal-14/glass/glass-mat-lib-macosx/src/com/sun/mat/ui/GlassApplication.m:163
Java has been detached already, but someone is still trying to use it at -[GlassRunnable run]:/HUDSON/workspace/presidio/label/macosx-universal-14/glass/glass-mat-lib-macosx/src/com/sun/mat/ui/GlassApplication.m:151
Java has been detached already, but someone is still trying to use it at -[GlassRunnable dealloc]:/HUDSON/workspace/presidio/label/macosx-universal-14/glass/glass-mat-lib-macosx/src/com/sun/mat/ui/GlassApplication.m:163
Exception in thread "Timer-0" java.lang.RuntimeException: Main Java thread is detached.
at com.sun.glass.ui.mac.MacApplication._invokeLater(Native Method)
at com.sun.glass.ui.Application.invokeLater(Application.java:171)
at com.sun.javafx.tk.quantum.QuantumToolkit.defer(QuantumToolkit.java:546)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:105)
at javafx.application.Platform.runLater(Platform.java:31)
at com.javafx.experiments.mediaplayer.MediaControl.updateValues(MediaControl.java:194)
at com.javafx.experiments.mediaplayer.MediaControl$2.invalidated(MediaControl.java:93)
at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:61)
at javafx.beans.property.ReadOnlyObjectWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyObjectWrapper.java:151)
at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:117)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:86)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:119)
at javafx.scene.media.MediaPlayer.setCurrentTime(MediaPlayer.java:1048)
at javafx.scene.media.MediaPlayer.updateTime(MediaPlayer.java:1456)
at javafx.scene.media.MediaPlayer$_MediaTimerTask.run(MediaPlayer.java:2269)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
1.2 J2D
$ java -Dprism.order=j2d -Djava.library.path=$JAVAFX_HOME/bin -classpath dist/MediaPlayer.jar:/Users/bpb/Work/presidio-scrum-media/artifacts/sdk/rt/lib/jfxrt.jar com.javafx.experiments.mediaplayer.MediaPlayer
2011-08-26 06:57:04.688 java[310:a07] Process manager already initialized -- can't fully enable headless mode.
onPlaying
Segmentation fault
(see attached screen shot and stack trace)
2. WebMap
2.1 ES2
bpb:{WebMap} $ java -Djava.library.path=$JAVAFX_HOME/bin -classpath /Users/bpb/Work/presidio-scrum-media/artifacts/sdk/rt/lib/jfxrt.jar:dist/WebMap.jar com.javafx.experiments.map.Main
WARNING: com.sun.javafx.css.StyleManager loadStylesheet Resource "null" not found.
WARNING: com.sun.javafx.css.StyleManager loadStylesheet Resource "null" not found.
Glass detected outstanding Java exception at _GlassTimerTask:/HUDSON/workspace/presidio/label/macosx-universal-14/glass/glass-mat-lib-macosx/src/com/sun/mat/ui/GlassTimer.m:48
Exception in thread "Glass Timer Thread" java.lang.RuntimeException: Main Java thread is detached.
at com.sun.glass.ui.mac.MacApplication._postOnEventQueue(Native Method)
at com.sun.glass.ui.Application.postOnEventQueue(Application.java:186)
at com.sun.javafx.tk.quantum.QuantumToolkit$11.run(QuantumToolkit.java:345)
^C
2.2 J2D
bpb:{WebMap} java -Dprism.order=j2d -Djava.library.path=$JAVAFX_HOME/bin -classpath /Users/bpb/Work/presidio-scrum-media/artifacts/sdk/rt/lib/jfxrt.jar:dist/WebMap.jar com.javafx.experiments.map.Main
WARNING: com.sun.javafx.css.StyleManager loadStylesheet Resource "null" not found.
WARNING: com.sun.javafx.css.StyleManager loadStylesheet Resource "null" not found.
2011-08-26 07:17:12.240 java[465:a07] Process manager already initialized -- can't fully enable headless mode.
Segmentation fault
(same crash as attached for MediaPlayer)