From bcbba62c7cf8547351d7331b579ec7e135d6d599 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 30 Sep 2021 00:52:38 +0200 Subject: [PATCH] platforms/drm: remove dangling pointer of lease outputs pipeline --- src/plugins/platforms/drm/drm_gpu.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/platforms/drm/drm_gpu.cpp b/src/plugins/platforms/drm/drm_gpu.cpp index bb6787a0c5..b20dbff99d 100644 --- a/src/plugins/platforms/drm/drm_gpu.cpp +++ b/src/plugins/platforms/drm/drm_gpu.cpp @@ -304,6 +304,8 @@ bool DrmGpu::updateOutputs() connectors.removeOne(output->pipeline()->connector()); crtcs.removeOne(output->pipeline()->crtc()); planes.removeOne(output->pipeline()->primaryPlane()); + } else { + m_pipelines.removeOne(output->pipeline()); } } auto config = findWorkingCombination({}, connectors, crtcs, planes); @@ -313,6 +315,11 @@ bool DrmGpu::updateOutputs() it.value()->setOutput(it.key()); config << it.value(); } + for (const auto &leaseOutput : qAsConst(m_leaseOutputs)) { + if (!leaseOutput->lease()) { + config << leaseOutput->pipeline(); + } + } } else { for (const auto &pipeline : qAsConst(oldPipelines)) { delete pipeline;