3
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2025-11-01 16:16:41 +00:00

internal: Prevent double-free in attemptDirectScanout (#10974)

This commit is contained in:
Kamikadze 2025-07-09 17:39:36 +05:00 committed by GitHub
parent 9517d0eaa4
commit c6497a7193
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
// btw buffer's syncReleaser will take care of signaling release point, so we don't do that here
PBUFFER->lock();
PBUFFER->onBackendRelease([PBUFFER]() { PBUFFER->unlock(); });
PBUFFER->onBackendRelease([wb = WP<IHLBuffer>{PBUFFER}] {
if (wb)
wb->unlock();
});
return true;
}