mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 23:21:57 -07:00
internal: Prevent double-free in attemptDirectScanout (#10974)
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user