Skip to content

Prevent double-free in attemptDirectScanout #10974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2025
Merged

Conversation

Kam1k4dze
Copy link
Contributor

@Kam1k4dze Kam1k4dze commented Jul 9, 2025

Fixes #10940

This is what came to my mind after looking at the asan #10940 (comment)
Sorry, if this is not right way to fix that.

@Kam1k4dze Kam1k4dze changed the title Prevent onBackendRelease double-free Prevent double-free in attemptDirectScanout Jul 9, 2025
@gulafaran
Copy link
Contributor

gulafaran commented Jul 9, 2025

just to keep it somewhat like the other lambda captures does i would do

PBUFFER->onBackendRelease([weakBuffer = WP<IHLBuffer>(PBUFFER)]() {
    if (!weakBuffer)
         return;
         
    weakBuffer->unlock();
});

but should work the same practically. 👍

@Kam1k4dze Kam1k4dze requested a review from vaxerski July 9, 2025 10:35
@vaxerski vaxerski merged commit c6497a7 into hyprwm:main Jul 9, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants