NetworkManager/clients
Thomas Haller 52dbab7d07 all: use nm_clear_pointer() instead of g_clear_pointer()
g_clear_pointer() would always cast the destroy notify function
pointer to GDestroyNotify. That means, it lost some type safety, like

   GPtrArray *ptr_arr = ...

   g_clear_pointer (&ptr_arr, g_array_unref);

Since glib 2.58 ([1]), g_clear_pointer() is also more type safe. But
this is not used by NetworkManager, because we don't set
GLIB_VERSION_MIN_REQUIRED to 2.58.

[1] f9a9902aac

We have nm_clear_pointer() to avoid this issue for a long time (pre
1.12.0). Possibly we should redefine in our source tree g_clear_pointer()
as nm_clear_pointer(). However, I don't like to patch glib functions
with our own variant. Arguably, we do patch g_clear_error() in
such a manner. But there the point is to make the function inlinable.

Also, nm_clear_pointer() returns a boolean that indicates whether
anything was cleared. That is sometimes useful. I think we should
just consistently use nm_clear_pointer() instead, which does always
the preferable thing.

Replace:

   sed 's/\<g_clear_pointer *(\([^;]*\), *\([a-z_A-Z0-9]\+\) *)/nm_clear_pointer (\1, \2)/g' $(git grep -l g_clear_pointer) -i
2020-03-23 11:22:38 +01:00
..
cli all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
cloud-setup shared/trivial: rename time related functions to use "nsec"/"msec" abbreviation instead of "ns"/"ms" 2020-02-10 19:11:50 +01:00
common clients: use nm_utils_ifname_valid() to validate interface name in nm_vpn_wireguard_import() 2020-02-26 17:51:13 +01:00
tests libnm,cli,ifcfg-rh: add ipv6.ra-timeout configuration option 2020-02-17 14:43:13 +01:00
tui all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
meson.build nm-online: use nmc_client_new_async() instead of nm_client_new_async() 2019-12-10 09:17:17 +01:00
nm-online.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00