File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ Bottom level categories:
4040
4141## Unreleased
4242
43+ ### v24.0.3 (2025-03-19)
44+
45+ #### Bug Fixes
46+ - Fix drop order in ` Surface ` , solving segfaults on exit on some systems. By @ed-2100 in [ #6997 ] ( https://github.com/gfx-rs/wgpu/pull/6997 )
47+
4348### v24.0.2 (2025-02-26)
4449
4550#### Bug Fixes
Original file line number Diff line number Diff line change @@ -23,12 +23,6 @@ static_assertions::assert_impl_all!(SurfaceConfiguration: Send, Sync);
2323/// [`GPUCanvasContext`](https://gpuweb.github.io/gpuweb/#canvas-context)
2424/// serves a similar role.
2525pub struct Surface < ' window > {
26- /// Optionally, keep the source of the handle used for the surface alive.
27- ///
28- /// This is useful for platforms where the surface is created from a window and the surface
29- /// would become invalid when the window is dropped.
30- pub ( crate ) _handle_source : Option < Box < dyn WindowHandle + ' window > > ,
31-
3226 /// Additional surface data returned by [`DynContext::instance_create_surface`].
3327 pub ( crate ) inner : dispatch:: DispatchSurface ,
3428
@@ -39,6 +33,14 @@ pub struct Surface<'window> {
3933 // be wrapped in a mutex and since the configuration is only supplied after the surface has
4034 // been created is is additionally wrapped in an option.
4135 pub ( crate ) config : Mutex < Option < SurfaceConfiguration > > ,
36+
37+ /// Optionally, keep the source of the handle used for the surface alive.
38+ ///
39+ /// This is useful for platforms where the surface is created from a window and the surface
40+ /// would become invalid when the window is dropped.
41+ ///
42+ /// SAFETY: This field must be dropped *after* all other fields to ensure proper cleanup.
43+ pub ( crate ) _handle_source : Option < Box < dyn WindowHandle + ' window > > ,
4244}
4345
4446impl Surface < ' _ > {
You can’t perform that action at this time.
0 commit comments