Skip to content

WindowHandle is not sound #3317

@daxpedda

Description

@daxpedda

Currently, the rwh::WindowHandle we return gets a lifetime to Window. Unfortunately this doesn't really work out because the actual lifetime of the Window isn't connected to it's semantic lifetime. If the EventLoop is exited, all Windows become invalid, therefor making all connected WindowHandles unsound to continue to use.

One simple solution that was proposed in IRC by Ralith is to extend the lifetime of all Windows even after the EventLoop was exited. This might be a viable solution as recreating the EventLoop isn't allowed anyway (except on Web).

For a more "proper" solution, we would have to introduce a lifetime to Window that is connected to the EventLoop. This would require a major API re-design.

Also discussed in:

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedC - needs discussionDirection must be ironed outS - apiDesign and usability

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions