Skip to content
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

runtime: fix null pointer deference on a window close #498

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

Jafaral
Copy link
Member

@Jafaral Jafaral commented Jan 5, 2025

We can't queue an event to a window after closing it. Move the queue call before we call wclose().
Simplify the code a bit in the process.

We can't queue an event to a window after closing it.
Move the queue call before we call wclose().
Simplify the code a bit in the process.

Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
@Jafaral Jafaral requested a review from Don-Ward January 5, 2025 20:33
Copy link
Collaborator

@Don-Ward Don-Ward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious from the diff listing that the change has the same effect as the original (except fixing the queue event on a closed window bug). But after reading the earlier code -- which sets ws = wb->window; it becomes clearer.

On a personal note, I think

   if (expr)
      return 1;

is actually worse than if (expr) return 1; but we could argue all day about coding conventions and still get nowhere (and it's not important enough to ask for changes).

@Don-Ward Don-Ward merged commit a4056ac into uniconproject:master Jan 5, 2025
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants