From ac6ff7ff410a5874680dbfd1cf1023dabc623c43 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Mon, 1 Jan 2024 09:57:51 +0400 Subject: tty: Disable dmabuf global before destroying --- src/handlers/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/handlers') diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 42f83a62..f7d94ed0 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -202,9 +202,11 @@ impl DmabufHandler for State { dmabuf: Dmabuf, notifier: ImportNotifier, ) { - let renderer = self.backend.renderer().expect( - "the dmabuf global must be created and destroyed together with the output device", - ); + let Some(renderer) = self.backend.renderer() else { + notifier.failed(); + return; + }; + match renderer.import_dmabuf(&dmabuf, None) { Ok(_texture) => { let _ = notifier.successful::(); -- cgit