Skip to content

backends/drm: Fix a crash in DrmGpu::releaseBuffers()

Currently, the code assumes that the primary and the cursor layers are always present. However, it's not guaranteed if the render backend cannot be recreated. Specifically:

  • the Compositor destroys the EglGbmBackend. The egl gbm backend, in its turn, resets the primary and the cursor layers to null
  • the Compositor tries to create the EglGbmBackend but that fails so it is destroyed. EglGbmBackend::~EglGbmBackend() calls DrmGpu::releaseBuffers(), but it hits an unexpected null primary layer.

Normally, the primary and the cursor layers would be created when the Compositor successfully creates the WorkspaceScene. Since the RenderBackend fails to initialize, the WorkspaceScene is not created and the DrmGpu doesn't recreate the layers.

Merge request reports