Skip to content

CtxRef::clone is a footgun #1005

@danielkeller

Description

@danielkeller

The docs for CtxRef prominently mention that it's an Arc and that it's cloneable. But starting a new frame mutates, not the context, but the CtxRef, invalidating prior clones. I'm sure there's a good reason for this, but in most libraries that give cloneable "handle" types (eg winit, wgpu, etc), mutating methods only affect the thing the handle points to, not the handle itself. I think the API and docs shouldn't suggest that CtxRef and Context are handles, or at least mention that they're handles only for the duration of one frame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions