Commits

Michael Ludwig committed 98475cf

Make more threads managed.

Comments (0)

Files changed (2)

ferox-renderer/ferox-renderer-lwjgl/src/main/java/com/ferox/renderer/impl/lwjgl/LwjglInputEventAdapter.java

 import com.ferox.input.MouseEvent;
 import com.ferox.input.MouseKeyEventSource;
 import com.ferox.input.MouseListener;
+import com.ferox.renderer.impl.LifeCycleManager;
 
 /**
  * A MouseKeyEventSource that wraps the static {@link Mouse} and
         mouseListeners = new ArrayList<MouseListener>();
     }
     
-    public void startPolling() {
+    public void startPolling(LifeCycleManager lifecycle) {
         synchronized(this) {
             if (poller != null)
                 throw new IllegalStateException("Already polling inputs");
             
             poller = new LwjglInputPoller();
-            Thread pollThread = new Thread(poller, "LWJGL Input Poller");
+            Thread pollThread = new Thread(lifecycle.getManagedThreadGroup(), poller, "lwjgl-input-poller");
             pollThread.setDaemon(true);
-            pollThread.start();
+            lifecycle.startManagedThread(pollThread);
         }
     }
     

ferox-renderer/ferox-renderer-lwjgl/src/main/java/com/ferox/renderer/impl/lwjgl/LwjglStaticDisplaySurface.java

      * management.
      */
     public void initialize() {
-        adapter.startPolling();
+        adapter.startPolling(getFramework().getLifeCycleManager());
         
         if (parentFrame == null) {
-            Thread closeMonitor = new Thread(new CloseMonitor(), "window-close-monitor");
+            ThreadGroup managedGroup = getFramework().getLifeCycleManager().getManagedThreadGroup();
+            Thread closeMonitor = new Thread(managedGroup, new CloseMonitor(), "window-close-monitor");
             closeMonitor.setDaemon(true);
             getFramework().getLifeCycleManager().startManagedThread(closeMonitor);
         } else {