Skip to main content

LumenCloseFn

Type Alias LumenCloseFn 

Source
pub type LumenCloseFn = unsafe extern "C" fn(user_data: *mut c_void) -> c_int;
Expand description

App-level close callback (ABI 0.5). Registered with lumen_app_on_close; invoked once per OS close request - the window close button, or (Unix) the first SIGINT/SIGTERM - before the runtime tears anything down, so embedders get a last chance to persist state.

Return nonzero to allow the close (the loop exits and lumen_app_run returns), or 0 to veto it and keep the window open - mirroring the script-side on_close() returning false. On Unix a second SIGINT/SIGTERM bypasses the hook and exits immediately, so a vetoing embedder cannot wedge shutdown.

Fires on the Lumen tick thread; user_data carries the same Send/Sync contract as lumen_app_expose’s.