Skip to content

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

Vlad Zahorodnii requested to merge work/cherry-pick-2ec45f33 into Plasma/6.1

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.

(cherry picked from commit 2ec45f33)

Co-authored-by: Vlad Zahorodnii vlad.zahorodnii@kde.org

Merge request reports

Loading