forge
Explore
Log in

Don't you dare go Hollow

Drop `GbmDevice` in the end

Browse files at this commit

345428bce76281efeee91336768c2d38282f8027Kirill ChibisovParent: 64ac316
The `GbmDevice` must be destroyed after destroying all the objects
associated with it.
src/backend/tty.rsmodified+4 -2
@@ -66,14 +66,16 @@ type GbmDrmCompositor = DrmCompositor<
66 struct OutputDevice {66 struct OutputDevice {
67 id: dev_t,67 id: dev_t,
68 token: RegistrationToken,68 token: RegistrationToken,
69- drm: DrmDevice,
70- gbm: GbmDevice<DrmDeviceFd>,
71 gles: GlesRenderer,69 gles: GlesRenderer,
72 formats: HashSet<DrmFormat>,70 formats: HashSet<DrmFormat>,
73 drm_scanner: DrmScanner,71 drm_scanner: DrmScanner,
74 surfaces: HashMap<crtc::Handle, Surface>,72 surfaces: HashMap<crtc::Handle, Surface>,
75 dmabuf_state: DmabufState,73 dmabuf_state: DmabufState,
76 dmabuf_global: DmabufGlobal,74 dmabuf_global: DmabufGlobal,
75+ // SAFETY: drop after all the objects used with them are dropped.
76+ // See https://github.com/Smithay/smithay/issues/1102.
77+ drm: DrmDevice,
78+ gbm: GbmDevice<DrmDeviceFd>,
77 }79 }
78 80
79 #[derive(Debug, Clone, Copy)]81 #[derive(Debug, Clone, Copy)]