StackOverflowError after Display.update()

Started by Eckelf, July 20, 2013, 22:18:00

Previous topic - Next topic

Eckelf

Hi there!

I am currently learning how to use OpenGL (through LWJGL). Things go pretty well but there is one major issue I have at the moment:
At some random point after startup a StackOverflowError occurs after calling Display.update(), as seen here: http://pastebin.com/eu1VeNV5.
I'm using a recursive render method that first calls Display.sync(60) and then Display.update().

Is this something someone has experienced before? Any ideas if that is a problem on my end or on LWJGL's?

quew8

I'm not sure how you can have a recursive render method, but that is definitely your problem. If recursive methods don't have a way of stopping themselves after a while, then they just keep adding to the call stack and it inevitably overflows. A loop is what you want, but please show some code, because I would sure like to see what you have.

Eckelf

That might be the problem then! I didn't think it was because it is running in its own thread, but it has not happened since I changed it to a loop.
Thanks for the advice! I will report back if it occurs again.