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

man: add message unref to sd_bus_call_method #32900

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ScuroGuardiano
Copy link

@ScuroGuardiano ScuroGuardiano commented May 17, 2024

Hello,

I added information when to use and when not to use sd_bus_message_unref to sd_bus_call_method(3).

@github-actions github-actions bot added documentation please-review PR is ready for (re-)review by a maintainer labels May 17, 2024
Copy link

Important

An -rc1 tag has been created and a release is being prepared, so please note that PRs introducing new features and APIs will be held back until the new version has been released.

functions into a single function call. When <parameter>reply</parameter> message returned from this function
is no longer needed, it should be unreferenced by calling
<citerefentry><refentrytitle>sd_bus_message_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
on it.</para>
Copy link
Member

Choose a reason for hiding this comment

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

This should be mentioned in sd_bus_call(3).

not call <citerefentry><refentrytitle>sd_bus_message_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
on it. If the callback wants to hold on to the message beyond the lifetime of the callback, it needs to call
<citerefentry><refentrytitle>sd_bus_message_ref</refentrytitle><manvolnum>3</manvolnum></citerefentry> to create a
new reference.</para>
Copy link
Member

Choose a reason for hiding this comment

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

Hm, this is copied from sd_bus_call(3). I do not think we should duplicate such...

Copy link
Member

Choose a reason for hiding this comment

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

actually it's an important point, so either the same wording or a reference to the exact paragraph is a good thing to have here too, better to have too much info than too little

Copy link
Member

@yuwata yuwata May 17, 2024

Choose a reason for hiding this comment

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

Then, let's extract this to another .xml file and include it for all sd_bus_*_async() functions.

@yuwata yuwata added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks
Development

Successfully merging this pull request may close these issues.

None yet

3 participants