platforms/drm: remove dangling pointer of lease outputs pipeline

This commit is contained in:
Xaver Hugl 2021-09-30 00:52:38 +02:00
parent 66badd905b
commit bcbba62c7c

View file

@ -304,6 +304,8 @@ bool DrmGpu::updateOutputs()
connectors.removeOne(output->pipeline()->connector()); connectors.removeOne(output->pipeline()->connector());
crtcs.removeOne(output->pipeline()->crtc()); crtcs.removeOne(output->pipeline()->crtc());
planes.removeOne(output->pipeline()->primaryPlane()); planes.removeOne(output->pipeline()->primaryPlane());
} else {
m_pipelines.removeOne(output->pipeline());
} }
} }
auto config = findWorkingCombination({}, connectors, crtcs, planes); auto config = findWorkingCombination({}, connectors, crtcs, planes);
@ -313,6 +315,11 @@ bool DrmGpu::updateOutputs()
it.value()->setOutput(it.key()); it.value()->setOutput(it.key());
config << it.value(); config << it.value();
} }
for (const auto &leaseOutput : qAsConst(m_leaseOutputs)) {
if (!leaseOutput->lease()) {
config << leaseOutput->pipeline();
}
}
} else { } else {
for (const auto &pipeline : qAsConst(oldPipelines)) { for (const auto &pipeline : qAsConst(oldPipelines)) {
delete pipeline; delete pipeline;