aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorphil <[email protected]>2016-11-01 20:27:02 +1300
committerphil <[email protected]>2016-11-01 20:27:02 +1300
commit3582d6d054f74fee68dcc74553cf504f10e0165c (patch)
treef8e491b08433e1c25ba49b3960e8f757d6152fc1 /src/main/java
parentf209b2906dc28156603bf7da54f96381a0bf726f (diff)
All Java3D threads set to daemon
Bug 1111 - Java3D does not dispose correctly after use Note there is a strong possibility that this could have side effects particularly in headless environments. However a daemon nature is more correct and will allow applications to exit gracefully and when expected. In testing normal swing operations can cause non-exiting. E.g. JFrame f = new JFrame(); f.pack(); will not exit unless f.dispose(); is called. This is unrelated to Java3D.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/jogamp/java3d/MasterControl.java3
-rw-r--r--src/main/java/org/jogamp/java3d/MasterControlThread.java1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/jogamp/java3d/MasterControl.java b/src/main/java/org/jogamp/java3d/MasterControl.java
index d5a9684..b60710c 100644
--- a/src/main/java/org/jogamp/java3d/MasterControl.java
+++ b/src/main/java/org/jogamp/java3d/MasterControl.java
@@ -1686,6 +1686,7 @@ private static String getProperty(final String prop) {
synchronized (rootThreadGroup) {
s.updateThread = new StructureUpdateThread(
rootThreadGroup, s, s.threadType);
+ s.updateThread.setDaemon(true);
s.updateThread.setPriority(threadPriority);
}
return null;
@@ -2010,6 +2011,7 @@ private static String getProperty(final String prop) {
public Object run() {
synchronized (rootThreadGroup) {
timerThread = new TimerThread(rootThreadGroup);
+ timerThread.setDaemon(true);
timerThread.setPriority(threadPriority);
}
return null;
@@ -2024,6 +2026,7 @@ private static String getProperty(final String prop) {
public Object run() {
synchronized (rootThreadGroup) {
notificationThread = new NotificationThread(rootThreadGroup);
+ notificationThread.setDaemon(true);
notificationThread.setPriority(threadPriority);
}
return null;
diff --git a/src/main/java/org/jogamp/java3d/MasterControlThread.java b/src/main/java/org/jogamp/java3d/MasterControlThread.java
index a27ce7f..914e506 100644
--- a/src/main/java/org/jogamp/java3d/MasterControlThread.java
+++ b/src/main/java/org/jogamp/java3d/MasterControlThread.java
@@ -50,6 +50,7 @@ class MasterControlThread extends Thread {
MasterControlThread(ThreadGroup threadGroup) {
super(threadGroup, "");
+ setDaemon(true);
setName("J3D-MasterControl-" + getInstanceNum());
VirtualUniverse.mc.createMCThreads();
this.start();