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

gio: Work around GLib memory leak in g_dbus_connection_register_objec… #1600

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion gio/src/dbus_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,19 @@ impl<'a> RegistrationBuilder<'a> {
let interface_name = args[3].get::<Option<&str>>().unwrap();
let method_name = args[4].get::<&str>().unwrap();
let parameters = args[5].get::<glib::Variant>().unwrap();
let invocation = args[6].get::<DBusMethodInvocation>().unwrap();

// Work around GLib memory leak: Assume that the invocation is passed
// as `transfer full` into the closure.
//
// This workaround is not going to break with future versions of
// GLib as fixing the bug was considered a breaking API change.
//
// See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4427
let invocation = from_glib_full(glib::gobject_ffi::g_value_get_object(
args[6].as_ptr(),
)
as *mut ffi::GDBusMethodInvocation);
Comment on lines +229 to +232
Copy link
Member Author

Choose a reason for hiding this comment

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

Indentation is a bit strange, not sure why rustfmt does this


f(
conn,
sender,
Expand Down
Loading