You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upon calling ImGui.getIO().getFonts().build(), after providing fonts via the addFontFromMemoryTTF method, the JVM crashes due to an EXCEPTION_ACCESS_VIOLATION relating to a null pointer.
I expected it to work the same as in prior releases. This has always been finicky for some reason, as minute changes to other irrelevant java code makes the difference between this error occuring and not.
Reproduction
The ImGui context is created on the main thread, however, calling build from the main thread after creating the fonts has no change in effect. There is only 1 thread ever modifying the font atlas, and normally all the below happens on a dedicated asset loading thread.
Font loading code:
// TTF file from the streambyte[] array = stream.readAllBytes();
// Only used to configure the font data. Must be specified.FontDatafontData = getFontData(assetManager.getResource(relativePath + ".info"));
this.size = fontData.size;
ImFontConfigitalicCfg = newImFontConfig(), boldCfg = newImFontConfig(), italicBoldCfg = newImFontConfig();
italicCfg.setFontBuilderFlags(Oblique);
boldCfg.setFontBuilderFlags(Bold);
italicBoldCfg.setFontBuilderFlags(Oblique | Bold);
ImFontAtlasfontAtlas = ImGui.getIO().getFonts();
ImFontfont = this.font = fontAtlas.addFontFromMemoryTTF(array, fontData.size, fontData.glyphRanges),
italic = this.italic = fontAtlas.addFontFromMemoryTTF(array, fontData.size, italicCfg, fontData.glyphRanges),
bold = this.bold = fontAtlas.addFontFromMemoryTTF(array, fontData.size, boldCfg, fontData.glyphRanges),
italicBold = this.italicBold = fontAtlas.addFontFromMemoryTTF(array, fontData.size, italicBoldCfg, fontData.glyphRanges);
On the same thead, the following is called (afterwards):
Version
1.87.5
What happened?
Upon calling
ImGui.getIO().getFonts().build()
, after providing fonts via theaddFontFromMemoryTTF
method, the JVM crashes due to an EXCEPTION_ACCESS_VIOLATION relating to a null pointer.I expected it to work the same as in prior releases. This has always been finicky for some reason, as minute changes to other irrelevant java code makes the difference between this error occuring and not.
Reproduction
The ImGui context is created on the main thread, however, calling
build
from the main thread after creating the fonts has no change in effect. There is only 1 thread ever modifying the font atlas, and normally all the below happens on a dedicated asset loading thread.Font loading code:
On the same thead, the following is called (afterwards):
Relevant log output
hs_err_pid1452.log
The text was updated successfully, but these errors were encountered: