Re: [MM] [PATCH] sms: use g_variant_new_from_data instead of g_variant_new_fixed_array



>> ModemManager configure script currenty requires glib 2.30.2 or later,
>> bud g_variant_new_fixed_array requires at least glib 2.32. To maintain
>> the compatibility with glib 2.30, this patch modifies the code to use
>> g_variant_new_from_data instead of g_variant_new_fixed_array.
> 
> Was thinking in putting the new code between GLIB_CHECK_VERSION(2,32,0),
> but the change is so simple that it's probably not worth it.
> 
> Pushed like this, thanks.
> 
> 

It wasn't that simple at the end :-)

Just for reference, g_variant_new_from_data() will actually use the
original array passed as input during its operation; which means that
the user of the method needs to make sure the input array is valid as
long as the variant is valid. That can easily be done using the
GDestroyNotify callback passed in g_variant_new_from_data(), like this:

http://cgit.freedesktop.org/ModemManager/ModemManager/commit/?id=ea87a4556e4f4d09d0c4eaa6d85a7efc85431328

Cheers!

-- 
Aleksander


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]