Skip to content

globalscope should hold weakref to GPUDevice #32519

Closed

Description

@sagudev

Lifetime of GPUDevice still bugs me, global scope has hashmap of Dom<GPUDevice> that keeps GPUDevice alive unless GPUDevice is manually destroyed, so we should probably use weakref in hashmap: https://doc.servo.org/script/dom/bindings/weakref/index.html, but this can be done as a follow up (this problem also exist on main).

EDIT There is also draft of better GPUDevice cleanup in webgpu project board: WebGPU (view)

Originally posted by @sagudev in #32354 (comment)

After this is implemented make sure that devices are actually dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-content/webgpu

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions