Thread.setDefaultUncaughtExceptionHandler in LwjglAbstractDisplay.initInThread()


I would like to ask if this part is intentional or it is a bug:

pre type="java"
            if (!JmeSystem.isLowPermissions()){

                Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {

                    public void uncaughtException(Thread thread, Throwable thrown) {

                        listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown);





The problem is, that in our case, the jME/OpenGL thread is only one of many others and we don’t like it sets the DefaultUncaughtExceptionHandler for whole JVM (the method setDefaultUncaughtExceptionHandler is static and it is used for all threads in JVM).

Thanks for replies,


1 Like

It was not intended … The handler should only be applied on the GL thread.

This is now fixed in SVN, thanks


Thanks for a quick fix.

Oh, guess thats the reason why those compile crashes are reported by jMP’s scene error report. Cool.

1 Like