gfx-rs/wgpu-rs

StagingBelt SendError (recall future finishes after the main gpu user is dropped)

Closed this issue · 1 comments

I'm using a slightly customized iced with a custom windowing integration in a GLib-async-based app.

In upstream iced the Compositor owns a LocalPool where the self.staging_belt.recall() future is spawned, and then run_until_stalled is used. I can't use LocalPool because the GLib executor is already running (unlike tokio it doesn't have the special magic integration that allows a LocalPool to still work).

I modified the code to spawn recall on the main GLib executor, adding Abortable to avoid the SendError situation in recall, which seemed to work, but now I have another situation where closing a window panics on the SendError.

So I'm wondering.. is it even correct that recall unwraps the send result? Should it ever panic on a SendError if it's an asynchronous process that might be finished right as the main graphics context is being dropped?

kvark commented

Panicking is a bad idea there, I agree!