exit([exitCode], [signal])

Class: SwingUI.

Description:

Gracefully exits the application with specified exit code (status code) and optional exit signal. Emits onExit() event handlers, closes connection to GUI and notifies GUI to gracefully exit. This is a recommended way to exit the application.

Parameters:

Name Type Default Description

[exitCode]

number

0

Exit code.

[signal]

string

One of received exit signals: SIGINT, SIGUSR1, SIGUSR2, SIGTERM, SIGHUP.

Returns:

Does not return a value.

Type: void

Examples:

Exiting the app gracefully:

ui.exit();
ui.exit(10); // existing with exit code 10

Also See: