Skip to content

What needs to be freed with glfwSet*Callback and GLFW*Callback? #868

Answered by ws909
tilkinsc asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, you can ignore lots of those warnings from IntelliJ. They're all over the place for lots of stuff. I ignore almost all of them. But, every now and then, they're useful at picking up something I missed, or some design ideas that didn't execute so well.

Just make a call to glfwFreeCallbacks before destroying your window. Your Java lambdas need to be converted into native functions, which is what LibFFI does for LWJGL when you pass Java lambdas to functions in the LWJGL bindings, that take function pointers. So you need to free this native function that is generated, once you're done with it.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@tilkinsc
Comment options

@ws909
Comment options

@tilkinsc
Comment options

Answer selected by tilkinsc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants