Skip to content

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

Merged
empirephoenix merged 3 commits into
jMonkeyEngine:masterfrom
Ali-RS:Ali-RS-patch-1
Dec 14, 2018
Merged

Added a (hacky) fix for a Java Swing/AWT + GLFW interaction issue…#968
empirephoenix merged 3 commits into
jMonkeyEngine:masterfrom
Ali-RS:Ali-RS-patch-1

Conversation

@Ali-RS

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

Copy link
Copy Markdown
Member



"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

Ali-RS commented Dec 10, 2018

Copy link
Copy Markdown
Member Author

@empirephoenix any thought ?

@empirephoenix

Copy link
Copy Markdown
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

Ali-RS commented Dec 12, 2018

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Contributor

Thanks for investigating this

@Ali-RS

Ali-RS commented Dec 14, 2018

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Member

Is this fix suitable for JME v3.2.2 ?

@Ali-RS

Ali-RS commented Dec 17, 2018

Copy link
Copy Markdown
Member Author

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