Gio::DBus::InterfaceVTable is leaked
The documentation correctly advises not to allocate Gio::DBus::InterfaceVTable
on the heap, as there's no easy way to destroy it; but the alternative, recommended way, is also not viable, because there's no way to get the instance of the object.
In C, one can specify a user_data
parameter to g_dbus_connection_register_object()
and retrieve it from the GDBusMethodInvocation
when a method is called. However, the Giomm implementation doesn't provide any way to pass a parameter to the vtable methods at registration time.
Consequently, one is forced to allocate the object on the heap, with no easy way to avoid a memory leak.
Edited by Alberto Mardegan