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 committed Nov 6, 2023
1 parent 49b7ec9 commit 8e7bc39
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 @@ -2296,12 +2296,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 8e7bc39

Please sign in to comment.