Closed Chryfi closed 6 months ago
Java is a garbage collected language. If the crashes are sort of unpredictable, my first theory would be that something has vanished, which shouldn't. You gotta be sure that all objects you are using, keep being referenced by someone else for the duration of the use by NanoVG and OpenGL. (For example: I would check that NanoVG.nvgFontFace(this.vg, font.toString());
does the right thing). Otherwise I have no idea.
I am just answering this, because no one else has, not because I have any deep insight
Thanks, it seems like it was the byetbuffer that I used for the font that got garbage collected. It was a mistake on my end.
I frequently get JVM crashes. Specs: Java 17, Windows 11, NanoVG 3.3.3 and LWJGL 3.3.1. They are sometimes random and never happen immediately after rendering. I create the NanoVGL3 context once and load my fonts to it like this
int fontHandle = NanoVG.nvgCreateFontMem(this.vg, font.getIdentifier().toString(), buffer.flip(), false);
in the end I do this
NanoVGGL3.nvgDelete(this.vg);
this is how I render
Besides that the only methods I call in other places are
here is the thread dump. hs_err_pid36308.log
Is this a bug or am I doing something wrong?