-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Use g_auto and G_VARIANT_BUILDER_INIT for all GVariantBuilders #1503
Use g_auto and G_VARIANT_BUILDER_INIT for all GVariantBuilders #1503
Conversation
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.
LGTM
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.
lgtm but not sure what the backport does, would be good to explain it in the commit message.
9821ba2
to
87fc06c
Compare
Dropped BUILDER_INIT_UNSET and its usage. |
the commit is still there. |
87fc06c
to
b498b6f
Compare
Woops, my bad. |
If it is missing, we just don't add it to the keyfile instead of running into criticals. The XdpAppInfo impl can still add the right command later on.
One has to be very careful about the control flow and early exits without the g_auto which can easily result in memory leaks. I noticed at least 5 cases where the change does fix a leak, even though it might be a bit hard to trigger. This also makes sure that all g_auto usages are initialized correctly.
b498b6f
to
65eb753
Compare
Always initialize g_auto(GVariantBuilder)
Use g_auto and G_VARIANT_BUILDER_INIT for all GVariantBuilders
One has to be very careful about the control flow and early exits
without the g_auto which can easily result in memory leaks. I noticed at
least 5 cases where the change does fix a leak, even though it might be
a bit hard to trigger.
This also makes sure that all g_auto usages are initialized correctly.