Skip to content

Commit

Permalink
Merge pull request #6591 from kevlahnota/master2
Browse files Browse the repository at this point in the history
try to prevent Splashscreen crash on Linux
  • Loading branch information
kevlahnota authored Nov 18, 2024
2 parents 9093c77 + f48cf95 commit a6f1b3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions forge-gui-mobile-dev/src/forge/app/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ public void exit() {

@Override
public void closeSplashScreen() {
// FIXME: on Linux system it can't close splashscreen image or crash with SIGSEGV? How come it works on other OS?
if (OperatingSystem.isUnix() || OperatingSystem.isSolaris())
return;
//could throw exception..
try {
Optional.ofNullable(SplashScreen.getSplashScreen()).ifPresent(SplashScreen::close);
Expand Down
3 changes: 1 addition & 2 deletions forge-gui-mobile/src/forge/Forge.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public static Localizer getLocalizer() {
public void create() {
//install our error handler
ExceptionHandler.registerErrorHandling();
getDeviceAdapter().closeSplashScreen();

GuiBase.setIsAndroid(Gdx.app.getType() == Application.ApplicationType.Android);

Expand Down Expand Up @@ -257,8 +258,6 @@ else if (getForgePreferences().getPref(FPref.UI_ENABLE_BORDER_MASKING).equals("f
/* call preloadExtendedArt here, if we put it above we will *
* get error: No OpenGL context found in the current thread. */
preloadExtendedArt();
// should be after create method but try to close this at a later time.
getDeviceAdapter().closeSplashScreen();
});
};
//see if app or assets need updating
Expand Down

0 comments on commit a6f1b3a

Please sign in to comment.