GDBusInterfaceVTable: clarify memory handling for the method() virtual function
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 9 Oct 2014 18:40:45 +0000 (14:40 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Tue, 28 Oct 2014 17:57:52 +0000 (13:57 -0400)
commit66fc112c742f56f85fc34b458325e87df4cd78d0
tree77c5ed4932b2cacb5ecb9c043f6a500c0560e5de
parent837d0b94a9bc96275c635450879c12fd54005426
GDBusInterfaceVTable: clarify memory handling for the method() virtual function

There are two consistent interpretations that could be taken for memory
handling of the 'invocation' parameter passed to the method_call() virtual
function of GDBusInterfaceVTable

 - A reference is passed (transfer full) to the method_call() virtual function,
   and that reference is then passed (transfer full) to the return_value/error
   functions on GDBusMethodInvocation.
 - An internal reference is retained from the point where method_call() is called
   until the return_value/error function is called.

Since the return_value/error functions were already marked (transfer full),
we use the first interpretation, annotate the invocation parameter of
method call as (transfer full) and describe this in the documentation, along
with the idea that you are always supposed to call one of the return_value/error
functions.

See bug 738122 for the leak this caused in GJS.

https://bugzilla.gnome.org/show_bug.cgi?id=738259
gio/gdbusconnection.h