summaryrefslogtreecommitdiff
path: root/clients/tui
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-23 11:00:43 +0100
committerThomas Haller <thaller@redhat.com>2020-03-23 11:05:34 +0100
commit073994ca4284a5e99314195981aa254f06c3bf69 (patch)
tree7d935de27616ff67fbedb141e2ee3152282dbfe2 /clients/tui
parentc50b4621d4415f9156e969a6a05fb37e1bb02e18 (diff)
downloadNetworkManager-073994ca4284a5e99314195981aa254f06c3bf69.tar.gz
all: use nm_clear_g_free() instead of g_clear_pointer()
I think it's preferable to use nm_clear_g_free() instead of g_clear_pointer(, g_free). The reasons are not very strong, but I think it is overall preferable to have a shorthand for this frequently used functionality. sed 's/\<g_clear_pointer *(\([^;]*\), *\(g_free\) *)/nm_clear_g_free (\1)/g' $(git grep -l g_clear_pointer) -i
Diffstat (limited to 'clients/tui')
-rw-r--r--clients/tui/newt/nmt-newt-grid.c8
-rw-r--r--clients/tui/nmt-connect-connection-list.c2
-rw-r--r--clients/tui/nmt-device-entry.c2
-rw-r--r--clients/tui/nmt-editor-grid.c2
-rw-r--r--clients/tui/nmt-page-team-port.c2
-rw-r--r--clients/tui/nmt-page-team.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/clients/tui/newt/nmt-newt-grid.c b/clients/tui/newt/nmt-newt-grid.c
index 68ac874ce1..ff41181288 100644
--- a/clients/tui/newt/nmt-newt-grid.c
+++ b/clients/tui/newt/nmt-newt-grid.c
@@ -78,10 +78,10 @@ nmt_newt_grid_finalize (GObject *object)
NmtNewtGridPrivate *priv = NMT_NEWT_GRID_GET_PRIVATE (object);
g_array_unref (priv->children);
- g_clear_pointer (&priv->row_heights, g_free);
- g_clear_pointer (&priv->col_widths, g_free);
- g_clear_pointer (&priv->expand_rows, g_free);
- g_clear_pointer (&priv->expand_cols, g_free);
+ nm_clear_g_free (&priv->row_heights);
+ nm_clear_g_free (&priv->col_widths);
+ nm_clear_g_free (&priv->expand_rows);
+ nm_clear_g_free (&priv->expand_cols);
G_OBJECT_CLASS (nmt_newt_grid_parent_class)->finalize (object);
}
diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c
index 1975b1c68a..411c2c00db 100644
--- a/clients/tui/nmt-connect-connection-list.c
+++ b/clients/tui/nmt-connect-connection-list.c
@@ -80,7 +80,7 @@ nmt_connect_connection_free (NmtConnectConnection *nmtconn)
static void
nmt_connect_device_free (NmtConnectDevice *nmtdev)
{
- g_clear_pointer (&nmtdev->name, g_free);
+ nm_clear_g_free (&nmtdev->name);
g_clear_object (&nmtdev->device);
g_slist_free_full (nmtdev->conns, (GDestroyNotify) nmt_connect_connection_free);
diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c
index 4ab593299c..264bd59d0b 100644
--- a/clients/tui/nmt-device-entry.c
+++ b/clients/tui/nmt-device-entry.c
@@ -299,7 +299,7 @@ nmt_device_entry_set_mac_address (NmtDeviceEntry *deventry,
priv->mac_address = g_strdup (mac_address);
changed = TRUE;
} else if (!mac_address && priv->mac_address) {
- g_clear_pointer (&priv->mac_address, g_free);
+ nm_clear_g_free (&priv->mac_address);
changed = TRUE;
} else if ( mac_address && priv->mac_address
&& !nm_utils_hwaddr_matches (mac_address, -1, priv->mac_address, -1)) {
diff --git a/clients/tui/nmt-editor-grid.c b/clients/tui/nmt-editor-grid.c
index a8ceedda36..ac00c82b1e 100644
--- a/clients/tui/nmt-editor-grid.c
+++ b/clients/tui/nmt-editor-grid.c
@@ -77,7 +77,7 @@ nmt_editor_grid_finalize (GObject *object)
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (object);
g_array_unref (priv->rows);
- g_clear_pointer (&priv->row_heights, g_free);
+ nm_clear_g_free (&priv->row_heights);
G_OBJECT_CLASS (nmt_editor_grid_parent_class)->finalize (object);
}
diff --git a/clients/tui/nmt-page-team-port.c b/clients/tui/nmt-page-team-port.c
index c91633e874..dfefd80c30 100644
--- a/clients/tui/nmt-page-team-port.c
+++ b/clients/tui/nmt-page-team-port.c
@@ -50,7 +50,7 @@ edit_clicked (NmtNewtButton *button,
new_config = nmt_newt_edit_string (config);
if (new_config && !*new_config)
- g_clear_pointer (&new_config, g_free);
+ nm_clear_g_free (&new_config);
g_object_set (G_OBJECT (priv->s_port),
NM_SETTING_TEAM_PORT_CONFIG, new_config,
NULL);
diff --git a/clients/tui/nmt-page-team.c b/clients/tui/nmt-page-team.c
index af84db4b81..a3d9d53a6c 100644
--- a/clients/tui/nmt-page-team.c
+++ b/clients/tui/nmt-page-team.c
@@ -103,7 +103,7 @@ edit_clicked (NmtNewtButton *button,
new_config = nmt_newt_edit_string (config);
if (new_config && !*new_config)
- g_clear_pointer (&new_config, g_free);
+ nm_clear_g_free (&new_config);
g_object_set (G_OBJECT (priv->s_team),
NM_SETTING_TEAM_CONFIG, new_config,
NULL);