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

Do not assign floating references to autoptrs #1437

Open
swick opened this issue Sep 23, 2024 · 0 comments
Open

Do not assign floating references to autoptrs #1437

swick opened this issue Sep 23, 2024 · 0 comments
Labels

Comments

@swick
Copy link
Contributor

swick commented Sep 23, 2024

Operating System

XDG Desktop Portal version

1.18

XDG Desktop Portal version (Other)

No response

Desktop Environment

Other

Desktop Environment (Other)

No response

Expected Behavior

Correct use of g_autoptr and floating refs

Current Behavior

We have a bunch of cases where we assign the result of g_variant_builder_end to a GVariant autoptr which will unref the floating variant in an early exit which is an error because the reference returned is floating:

g_autoptr(GVariant) options = NULL;
...
options = g_variant_builder_end (&options_builder);
if (...)
  return;

Steps to Reproduce

.

Anything else we should know?

No response

@swick swick added the bug label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant