diff --git a/crates/egui-wgpu/src/winit.rs b/crates/egui-wgpu/src/winit.rs index 26b3c86ae2c..d554159527e 100644 --- a/crates/egui-wgpu/src/winit.rs +++ b/crates/egui-wgpu/src/winit.rs @@ -668,13 +668,6 @@ impl Painter { ); } - { - let mut renderer = render_state.renderer.write(); - for id in &textures_delta.free { - renderer.free_texture(id); - } - } - let encoded = { crate::profile_scope!("CommandEncoder::finish"); encoder.finish() @@ -691,6 +684,13 @@ impl Painter { vsync_sec += start.elapsed().as_secs_f32(); }; + { + let mut renderer = render_state.renderer.write(); + for id in &textures_delta.free { + renderer.free_texture(id); + } + } + let screenshot = if capture { self.screen_capture_state .as_ref()