[PATCH] libmm-glib: set clear func by default in the MMModemPortInfo array

Aleksander Morgado aleksander at aleksander.es
Fri Feb 10 09:32:41 UTC 2017


On Thu, Feb 9, 2017 at 3:54 PM, Piotr Figiel <figiel at gmail.com> wrote:
>  I tested your patch and the reported issue doesn't appear any longer.
>  It all looks good and certainly better (more glib-style) than my initial
> implementation. Although I wonder if this doesn't ever collide with
> mm_modem_port_info_array_free() in mm-helper-types.c? It seems that two ways
> of dealing with memory management are taken for the same data structure,
> though I didn't observe any double-free's on this part during runtime, so I
> guess this must be correct.

No, they won't collide. The mm_modem_port_info_array_free() frees a
plain array of MMModemPortInfo, and is meant to be used by users of
the API. The GArray and its clear_func are internal to libmm-glib.

Thanks for testing, pushed to git master, mm-1-6, mm-1-4 and mm-1-2.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list