Skip to content

Commit

Permalink
Fix Panic in Surface Configure (gfx-rs#4635)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored and bonsairobo committed Mar 1, 2024
1 parent c53b3a0 commit 940283b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wgpu-core/src/device/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2107,12 +2107,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
log::info!("configuring surface with {:?}", config);

let error = 'outer: loop {
let hub = A::hub(self);
let mut token = Token::root();

// User callbacks must not be called while we are holding locks.
let user_callbacks;
{
let hub = A::hub(self);
let mut token = Token::root();

let (mut surface_guard, mut token) = self.surfaces.write(&mut token);
let (adapter_guard, mut token) = hub.adapters.read(&mut token);
let (device_guard, mut token) = hub.devices.read(&mut token);
Expand Down

0 comments on commit 940283b

Please sign in to comment.