internal: Prevent double-free in attemptDirectScanout (#10974)
This commit is contained in:
parent
9517d0eaa4
commit
c6497a7193
1 changed files with 4 additions and 1 deletions
|
|
@ -1554,7 +1554,10 @@ bool CMonitor::attemptDirectScanout() {
|
||||||
// lock buffer while DRM/KMS is using it, then release it when page flip happens since DRM/KMS should be done by then
|
// lock buffer while DRM/KMS is using it, then release it when page flip happens since DRM/KMS should be done by then
|
||||||
// btw buffer's syncReleaser will take care of signaling release point, so we don't do that here
|
// btw buffer's syncReleaser will take care of signaling release point, so we don't do that here
|
||||||
PBUFFER->lock();
|
PBUFFER->lock();
|
||||||
PBUFFER->onBackendRelease([PBUFFER]() { PBUFFER->unlock(); });
|
PBUFFER->onBackendRelease([wb = WP<IHLBuffer>{PBUFFER}] {
|
||||||
|
if (wb)
|
||||||
|
wb->unlock();
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue