code: public static void exit() {
          final Application application = Gdx.app;
          if (application == null) {
              return;
          } else if (isRunningOnGwt()) {
              // GWT Application#exit() implementation is empty. Disposing manually.
              if (application.getApplicationListener() != null) {
                  application.getApplicationListener().dispose();
                  // Application is now destroyed - silencing the (expected) rendering exceptions:
                  application.setLogLevel(Application.LOG_NONE);
              }
          } else {
              application.exit();
          }
      }
docs: Attempts to close the application on each platform. Calls {@link Application#exit()} on regular platforms and
  manually calls {@link ApplicationListener#dispose()} on GWT, as it doesn't implement exit method properly.
  Null-safe, this method will have an effect only if both {@link Application} and {@link ApplicationListener} are
  created and assigned.