-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Remove in-line NULL-checks before SDL_free() #14276
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
Conversation
|
Hmm, we probably don't want the coccinelle patch, but otherwise, @icculus, how do you feel about this? |
|
Actually, POSIX explicitly states that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. I clean these out when I find them, so it's nice to have it all done at once.
We don't need the coccinelle patch.
Replaces the pattern
if (ptr) {
SDL_free(ptr);
}
with
SDL_free(ptr);
|
Rebased and ready to go. (The RISCOS build failed to bring up the container.) |
|
maybe we can keep the patch, so that it can be run once in a while |
|
Merged, thanks! |
|
That was my original intent by including it @1bsyl, that maybe you'd want to make it e.g part of the checklist for releasing a major version. I didn't actually hook/link it into anything because I didn't want to add work for maintainers out of the blue. The spatch is trivial, but I pasted it into the top post for posterity. |
This may have already been discussed and rejected before, in which case I apologize for the noise, but I got inspired by a recent change merged to mesa.
This branch contains the result of applying a coccinelle spatch to remove basic NULL checks before
SDL_free():I also 'manually' did the same for
free(), but there were only three occurences.