Hi Peter,

> >> I'm writing a network backend for connman for PackageKit
> >> in C(Not python). Everything is fine but I'm a bit
> >> confused by how to free memory returned by
> >> GetProperties. With GetProperties, it filles a hash
> >> table with all properties of an object like manager or
> >> service even the caller is only interested in State, for
> >> example. So how to free those memory quickly without
> >> writing so much g_free code?? Is this possible?       
> > 
> > what D-Bus bindings are you using? Low-level or GLib
> > D-Bus? I assume it is the GLib one since you have a hash
> > table. So as far as I recall, you don't have to free the
> > hash table at all in the callback of the D-Bus function
> > if you are using async calls. However I might be wrong
> > here and you should double check with valgrind. 
> > 
> I use sync call like what connman-gnome does. It might be a good idea to have 
> multiple get_XX() methods than a single GetProperties().

no it is not a good idea. Trust me on that one, you don't wanna do
round-trips to D-Bus.

And normally sync calls are bad. I would prefer if you do this properly
async. Except the PK stuff is threaded anyway.

Regards

Marcel


_______________________________________________
connman mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/connman

Reply via email to