Fix DrmOutput sometimes being freed with a pending pageflip, often when waking from sleep.
It is possible for updateOutputs to be called when a pageflip is pending. Freeing a DrmOutput with a pending pageflip is not allowed (see ~DrmOutput assert - the page flip handler will be called on the freed memory, possibly leading to use-after-free). This works around the problem by delaying the destruction with teardown(). BUG: 422460
This commit is contained in:
parent
9e1bb1f130
commit
6c9026628c
1 changed files with 5 additions and 1 deletions
|
@ -519,7 +519,11 @@ bool DrmBackend::updateOutputs()
|
|||
emit screensQueried();
|
||||
}
|
||||
|
||||
qDeleteAll(removedOutputs);
|
||||
for(DrmOutput* removedOutput : removedOutputs) {
|
||||
removedOutput->teardown();
|
||||
removedOutput->m_crtc = nullptr;
|
||||
removedOutput->m_conn = nullptr;
|
||||
}
|
||||
qDeleteAll(oldConnectors);
|
||||
qDeleteAll(oldCrtcs);
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue