[...]
This is cause by the abrupt way the tutorial exits the game. It calls System.exit(0) at a time when we could be rendering. To prevent it, instead of calling System.exit(0) set a flag and use it to call exit() inside the rendering loop. The problem is that the rendering thread continues even through the window has been destroyed at exit.[...]
1 2 3 4 5 6
| boolean running=true; [...] while(running){ stuff } |
Or while(!finished), but I like the "positive" version a bit more.