Not quite sure what is going on. This crash does not happen on MacOS, but always happens on my windows machine. If I call either nnvgText or nvgText over an extended period of time, the JVM will crash.
Here's the crash log:
https://pastebin.com/DrX29TUfIf there's any more info you need let me know. If you'd like to see the project I've created let me know as well, if it'll help.
Here's my drawing code:
@Override
public void render(Context context) {
long vg = context.getNVG();
float absX = (int)getAbsoluteX();
float absY = (int)getAbsoluteY();
ByteBuffer textBuffer = null;
try {
textBuffer = MemoryUtil.memUTF8(text, false);
long start = MemoryUtil.memAddress(textBuffer);
long end = start + textBuffer.remaining();
// Draw
NanoVG.nvgFontSize(vg, fontSize);
NanoVG.nvgFontFace(vg, Font.SANS.getFont(fontStyle));
NanoVG.nvgTextAlign(vg,NanoVG.NVG_ALIGN_LEFT|NanoVG.NVG_ALIGN_TOP);
NanoVG.nvgBeginPath(vg);
NanoVG.nvgFontBlur(vg,0);
NanoVG.nvgFillColor(vg, textColor.getNVG());
NanoVG.nnvgText(vg, absX, absY, start, end);
} finally {
if (textBuffer != null) {
MemoryUtil.memFree(textBuffer);
}
}
}