-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Do not allow a null CEGLSync
to reach doOnReadable
#10976
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
base: main
Are you sure you want to change the base?
Conversation
you could use the isValid to catch more cases.
question is if it should call onSyncFired directly then or return? |
I'm not sure that'll work. |
oh lol the CEGLSync::isValid() is rather broken indeed, if the creation fails nullptr is returned. and isValid wont work. |
Actually, never mind. I think the problem is |
when is this crashing? |
ah renderer does this, Hyprland/src/render/Renderer.cpp Line 2316 in 9517d0e
|
When trying to run a debug build of Hyprland, it was crashing while starting up. It has something to do with |
now the question still remains if at the end it should just call onSyncFired() anyways. |
if we can't sync, we should not try to triple buffer, as it won't work. Entire pipeline should be skipped and fallback to standard frame sync should be used |
Describe your PR, what does it fix/add?
The function
CEventLoopManager::doOnReadable
is expecting its first parameter to be a non-null value, butCEGLSync::create
can potentially return anullptr
.If
m_sync
is null, and it reachesdoOnReadable
, Hyprland will crash.Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
This is one way of addressing the problem, but there may be a better one. For example, maybe the null check should happen directly in
doOnReadable
. Here, I'm checking only where a null value might potentially reach the function.Is it ready for merging, or does it need work?
It's ready for merging.