File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,19 @@ impl<'a> RegistrationBuilder<'a> {
218
218
let interface_name = args[ 3 ] . get :: < Option < & str > > ( ) . unwrap ( ) ;
219
219
let method_name = args[ 4 ] . get :: < & str > ( ) . unwrap ( ) ;
220
220
let parameters = args[ 5 ] . get :: < glib:: Variant > ( ) . unwrap ( ) ;
221
- let invocation = args[ 6 ] . get :: < DBusMethodInvocation > ( ) . unwrap ( ) ;
221
+
222
+ // Work around GLib memory leak: Assume that the invocation is passed
223
+ // as `transfer full` into the closure.
224
+ //
225
+ // This workaround is not going to break with future versions of
226
+ // GLib as fixing the bug was considered a breaking API change.
227
+ //
228
+ // See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4427
229
+ let invocation = from_glib_full ( glib:: gobject_ffi:: g_value_get_object (
230
+ args[ 6 ] . as_ptr ( ) ,
231
+ )
232
+ as * mut ffi:: GDBusMethodInvocation ) ;
233
+
222
234
f (
223
235
conn,
224
236
sender,
You can’t perform that action at this time.
0 commit comments