oωo (owo-lib)

oωo (owo-lib)

29M Downloads

jvm crash upon inventory exit when cursors aren't installed on system

queenofthebees opened this issue · 4 comments

commented

two parts to this!

  1. 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.
  2. 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)

commented

Can we backport the fix to older versions? It would be really nice, since many modded players are still on 1.20.1.

commented

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)

commented

I suggest opening a version-specific issue, considering this is about backporting a fix

commented

An issue? So I wouldn't be uploading anything, just asking again for the thing I did?