gapplication: don't rely on cmdline being finalized immediately
gapplication: don't rely on cmdline being finalized immediately

The GApplicationCommandLine DBus implementation currently calls
g_dbus_method_invocation_return_value() in its finalize() implementation
only, relying on the object being destroyed after g_object_unref() is
called on it inside g_application_impl_method_call().

While this is usually fine for C applications, when overriding the
command_line vfunc from language bindings, the binding might add extra
references to the object, which might not be released immediately - e.g.
because they're garbage collected, or possibly even leaked. The same
scenario could happen in a C application that decides to keep a
reference to the passed-in GApplicationCommandLine object.

To ensure the CommandLine DBus method always gets a reply after the
invocation of command_line in the primary instance, explicitly send the
message back before dropping our reference to the object.

https://bugzilla.gnome.org/show_bug.cgi?id=708042

krichter722/glib,Distrotech/glib,cention-sany/glib,endlessm/glib,johne53/MB3Glib,tchakabam/glib,cention-sany/glib,johne53/MB3Glib,Distrotech/glib,tchakabam/glib,tchakabam/glib,ieei/glib,Distrotech/glib,gale320/glib,endlessm/glib,lukasz-skalski/glib,johne53/MB3Glib,cention-sany/glib,mzabaluev/glib,lukasz-skalski/glib,johne53/MB3Glib,krichter722/glib,gale320/glib,MathieuDuponchelle/glib,endlessm/glib,tamaskenez/glib,MathieuDuponchelle/glib,mzabaluev/glib,johne53/MB3Glib,tchakabam/glib,gale320/glib,MathieuDuponchelle/glib,endlessm/glib,krichter722/glib,mzabaluev/glib,endlessm/glib,MathieuDuponchelle/glib,ieei/glib,krichter722/glib,mzabaluev/glib,ieei/glib,gale320/glib,lukasz-skalski/glib,ieei/glib,johne53/MB3Glib,Distrotech/glib,tamaskenez/glib,lukasz-skalski/glib,MathieuDuponchelle/glib,tamaskenez/glib,ieei/glib,Distrotech/glib,tchakabam/glib,cention-sany/glib,mzabaluev/glib,lukasz-skalski/glib,tamaskenez/glib,tamaskenez/glib,krichter722/glib,gale320/glib,cention-sany/glib