Winit's EventLoop ::run() method never returns and the current implementation calls std::process::exit which is a pretty huge hammer.
By forcibly killing the process like this could break normal lifecycle management in case the application is based on a Java subclass of Activity that might want to handle lifecycle events - e.g. to gracefully save state
It also means it's not possible to run more than one Winit event loop per process (e.g. via multiple Activities that are started within the same process).
Since Winit can't really assume that it's safe to call std::process::exit it should maybe just enter an infinite AndroidApp::poll_events loop instead. Additionally it could emit a warning/error since that's also almost certainly not really what anyone wants.
Winit's EventLoop
::run()
method never returns and the current implementation callsstd::process::exit
which is a pretty huge hammer.By forcibly killing the process like this could break normal lifecycle management in case the application is based on a Java subclass of
Activity
that might want to handle lifecycle events - e.g. to gracefully save stateIt also means it's not possible to run more than one Winit event loop per process (e.g. via multiple Activities that are started within the same process).
Since Winit can't really assume that it's safe to call
std::process::exit
it should maybe just enter an infiniteAndroidApp::poll_events
loop instead. Additionally it could emit a warning/error since that's also almost certainly not really what anyone wants.