API Reference / @gtkx/runtime / quitApplication
Variable: quitApplication
constquitApplication: (application) =>void
Defined in: packages/runtime/dist/lifecycle.d.ts:97
Detaches every window from the application and runs GLib's own shutdown, which emits shutdown, destroys the application implementation and releases the D-Bus registration. Does nothing for an application that is not registered, so a repeated call is a no-op.
GLib's own shutdown is reachable once per application: reaching it marks the application as quitting, which GLib never undoes. An application that has already quit falls back to emitting shutdown, which releases the runtime and leaves the registration for GLib to drop at finalize.
The process-wide default runApplication claimed is given up whichever of those paths the application took, including the ones that have no teardown left to do, so Gio.Application.getDefault() never hands back an application that has been torn down or that never registered in the first place. GLib clears that default only at finalize, which a garbage-collected wrapper reaches arbitrarily late or never.
Parameters
application
ApplicationLike
The application to shut down.
Returns
void