Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get an error when I try to flap #2

Open
Kcoops97 opened this issue Jun 4, 2015 · 4 comments
Open

I get an error when I try to flap #2

Kcoops97 opened this issue Jun 4, 2015 · 4 comments

Comments

@Kcoops97
Copy link

Kcoops97 commented Jun 4, 2015

Exception in thread "Game" org.lwjgl.system.libffi.ClosureError: Callback failed because the closure instance has been garbage collected.
at org.lwjgl.glfw.GLFW.glfwPollEvents(Native Method)
at com.example.kieran.SpaceHopper2.Main.update(Main.java:113)
at com.example.kieran.SpaceHopper2.Main.run(Main.java:92)
at java.lang.Thread.run(Unknown Source)

@OctavioGalland
Copy link

It's because the Input class with the glfw callback needs to be stored somewhere so it doesn't get garbage collected, you should create a property with type Input in the Main class, instanciate it, and assign it to the callback. That way, the instance of Input will be stored on memory and won't be collected by the gc

@gnuwilliam
Copy link

@ochi12 is right. Do something like

private Input input = new Input();

And then use it in the glfwSetKeyCallback:

glfwSetKeyCallback(window, input);

This should fix the problem

@guillesolana
Copy link

Muchas gracias me sirvió de mucha ayuda!!!

@felixrichnow
Copy link

I'm getting an issue. I had some problems with his tutorial as a lot of things are updated.
So I decided to download the full code and update what I could.
I've done so and now the game starts. But no pipes are loaded and there's an error:

Could not find uniform variable 'ml_matrix'!
1281
Could not find uniform variable 'top'!

Being printed out over and over again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants