No subject

Carlo Lobrano c.lobrano at gmail.com
Tue Dec 22 08:27:59 PST 2015


Hi all,

I am using cinterion and other plugins as reference to implement
load_supported_bands for Telit plugin, but there is a point which is not
clear for me.

In my reference plugins I've always seen this kind of result assignement

supported_bands_ready (...) {
       /* get the results */
       g_simple_async_result_set_op_res_gpointer (simple,
                                                   bands,
                                                   (GDestroyNotify)
g_array_unref);
       g_simple_async_result_complete (operation_result);
       g_object_unref (operation_result);
}

where bands is a GArray* that might contain the list of supported bands if
everything went fine or NULL otherwise.

My question is: there is any kind of memory leak here? Is it correct to use
g_array_ref(bands) instead?

supported_bands_ready (...) {
       /* get the results */
       g_simple_async_result_set_op_res_gpointer (simple,
                                                   g_array_ref(bands),
                                                   (GDestroyNotify)
g_array_unref);
       g_simple_async_result_complete (operation_result);
       g_object_unref (operation_result);
}


Best regards,
Carlo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/modemmanager-devel/attachments/20151222/4403ba12/attachment.html>


More information about the ModemManager-devel mailing list