Skip to content

Winit based examples should probably use EventLoop::run_return not EventLoop::run #3

@rib

Description

@rib

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions