Skip to content

Commit 8558dcb

Browse files
Ali-RSstephengold
authored andcommitted
Added a (hacky) fix for a Java Swing/AWT + GLFW interaction issue… (#968)
* 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. "
1 parent b5cb4c0 commit 8558dcb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jme3-desktop/src/main/java/com/jme3/app/SettingsDialog.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,12 @@ public void actionPerformed(ActionEvent e) {
442442
if (verifyAndSaveCurrentSelection()) {
443443
setUserSelection(APPROVE_SELECTION);
444444
dispose();
445+
446+
// System.gc() should be called to prevent "X Error of failed request: RenderBadPicture (invalid Picture parameter)"
447+
// on Linux when using AWT/Swing + GLFW.
448+
// For more info see: https://github.com/LWJGL/lwjgl3/issues/149, https://hub.jmonkeyengine.org/t/experimenting-lwjgl3/37275
449+
System.gc();
450+
System.gc();
445451
}
446452
}
447453
});

0 commit comments

Comments
 (0)