libmm-glib,pco: deprecate mm_pco_list_free()

Use g_list_free_full() using g_object_unref() as #GDestroyNotify
function instead.
This commit is contained in:
Aleksander Morgado
2019-10-28 10:39:22 +01:00
parent 5dd829174f
commit b076653ef0
3 changed files with 15 additions and 5 deletions

View File

@@ -353,10 +353,9 @@ mm_modem_3gpp_get_eps_ue_mode_operation (MMModem3gpp *self)
*
* Get the list of #MMPco received from the network.
*
* The caller is responsible for freeing the returned #GList with
* mm_pco_list_free().
*
* Returns: (element-type ModemManager.Pco) (transfer full): A list of #MMPco.
* Returns: (transfer full) (element-type ModemManager.Pco): a list of #MMPco
* objects, or #NULL if @error is set. The returned value should be freed with
* g_list_free_full() using g_object_unref() as #GDestroyNotify function.
*
* Since: 1.10
*/

View File

@@ -246,6 +246,8 @@ mm_pco_to_variant (MMPco *self)
/*****************************************************************************/
#ifndef MM_DISABLE_DEPRECATED
/**
* mm_pco_list_free:
* @pco_list: (transfer full)(element-type ModemManager.Pco): a #GList of
@@ -254,6 +256,8 @@ mm_pco_to_variant (MMPco *self)
* Frees all of the memory used by a #GList of #MMPco.
*
* Since: 1.10
* Deprecated: 1.12.0: Use g_list_free_full() using g_object_unref() as
* #GDestroyNotify function instead.
*/
void
mm_pco_list_free (GList *pco_list)
@@ -261,6 +265,8 @@ mm_pco_list_free (GList *pco_list)
g_list_free_full (pco_list, g_object_unref);
}
#endif /* MM_DISABLE_DEPRECATED */
/**
* mm_pco_list_add: (skip)
*/

View File

@@ -64,7 +64,12 @@ gboolean mm_pco_is_complete (MMPco *self);
const guint8 *mm_pco_get_data (MMPco *self,
gsize *data_size);
void mm_pco_list_free (GList *pco_list);
#ifndef MM_DISABLE_DEPRECATED
G_DEPRECATED
void mm_pco_list_free (GList *pco_list);
#endif
/*****************************************************************************/
/* ModemManager/libmm-glib/mmcli specific methods */