jvm crash upon inventory exit when cursors aren't installed on system
queenofthebees opened this issue · 4 comments
two parts to this!
- when any requested cursor in CursorAdapter isn't available on your operating system, glfw returns a null pointer. passing the null pointer to glfwDestroyCursor trips LWJGL's Checks, throwing a nullpointerexception.
- the npe then causes the current screen to be destructed, re-calling destruct on CursorAdapter, calling glfwDestroyCursor on already-freed cursors, resulting in a JVM segfault
easy fix would be filtering for nulls (well, in this case, 0s) before calling glfwDestroyCursor (and also setting the destructed variable before destroying the cursors instead of after)
Can we backport the fix to older versions? It would be really nice, since many modded players are still on 1.20.1.
I managed to compile a corrected version for 1.20.1. Is there any way I can upload it here for the rest of the 1.20.1 modded community? If anyone wants it just contact me anyway.
(The only thing I made was I added those lines of code that Dragon-Seeker here committed)
I suggest opening a version-specific issue, considering this is about backporting a fix