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

Added a (hacky) fix for a Java Swing/AWT + GLFW interaction issue… #968

Merged
merged 3 commits into from
Dec 14, 2018
Merged

Added a (hacky) fix for a Java Swing/AWT + GLFW interaction issue… #968

merged 3 commits into from
Dec 14, 2018

Conversation

Ali-RS
Copy link
Member

@Ali-RS Ali-RS commented Dec 9, 2018



"Run System.gc(), at least two times. Not sure how AWT handles native
resources, maybe there’s a finalizable/PhantomRef-ed resource that is not
released immediately, but a subsequent GC triggers a (too late) free. "
@Ali-RS
Copy link
Member Author

Ali-RS commented Dec 10, 2018

@empirephoenix any thought ?

@empirephoenix
Copy link
Contributor

I had the BadRenderer issue a lot of times in smaller Tests, but never in my full Application, this would explain this. While this is extremly ugly, if it makes stuff work 99% of the time it is still a great improvement. So from my point of view this might be ok. Might another approch be, to drain the XWindow error queue on JME-LWJGL3 init?

@Ali-RS
Copy link
Member Author

Ali-RS commented Dec 12, 2018

@pspeed42
@MeFisto94
If you are OK with this PR, then would you mind to merge it please :)

@empirephoenix empirephoenix merged commit a47b4a4 into jMonkeyEngine:master Dec 14, 2018
@empirephoenix
Copy link
Contributor

Thanks for investigating this

@Ali-RS
Copy link
Member Author

Ali-RS commented Dec 14, 2018

@empirephoenix thanks for merging it.

Regarding

Might another approch be, to drain the XWindow error queue on JME-LWJGL3 init?

I took a look at it but was unable to understand what is going on there. Sorry about that :(

I just cloned this PR from what @Renanse did here : Renanse/Ardor3D@3984929
Based on what @Spasi said here LWJGL/lwjgl3#149 (comment)
And tested it on JME. It works just fine.

@Ali-RS Ali-RS deleted the Ali-RS-patch-1 branch December 14, 2018 08:56
@stephengold
Copy link
Member

Is this fix suitable for JME v3.2.2 ?

@Ali-RS
Copy link
Member Author

Ali-RS commented Dec 17, 2018

Don't see any strong reason why it should not be :)

@stephengold stephengold added this to the v3.2.2 milestone Dec 17, 2018
stephengold pushed a commit that referenced this pull request Dec 22, 2018
)

* Added a (hacky) fix for a Java Swing/AWT + GLFW interaction issue… 

… on Linux.

* Added a proper comment

* Added an extra call to System.gc() as recommendation from lwjgl’s @Spasi

"Run System.gc(), at least two times. Not sure how AWT handles native
resources, maybe there’s a finalizable/PhantomRef-ed resource that is not
released immediately, but a subsequent GC triggers a (too late) free. "
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

Successfully merging this pull request may close these issues.

3 participants