From 43febd92ff99568cd9656091940899eee2a6090b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 25 Oct 2023 13:40:53 +0200 Subject: [PATCH] libnm: drop unnecessary cleanup of direct strv properties Direct properties are automatically cleaned up by the base class (_finalize_direct()). No need to duplicate that. The point of the direct property implementation is to free us from this repeated cumbersome steps (and forgetting this step without a direct property would not be only unnecessary, but erroneous). --- src/libnm-core-impl/nm-setting-connection.c | 1 - src/libnm-core-impl/nm-setting-match.c | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/src/libnm-core-impl/nm-setting-connection.c b/src/libnm-core-impl/nm-setting-connection.c index 898931440c..018332bc2d 100644 --- a/src/libnm-core-impl/nm-setting-connection.c +++ b/src/libnm-core-impl/nm-setting-connection.c @@ -1796,7 +1796,6 @@ finalize(GObject *object) NMSettingConnectionPrivate *priv = NM_SETTING_CONNECTION_GET_PRIVATE(object); nm_clear_pointer(&priv->permissions, g_array_unref); - nm_clear_pointer(&priv->secondaries.arr, g_array_unref); G_OBJECT_CLASS(nm_setting_connection_parent_class)->finalize(object); } diff --git a/src/libnm-core-impl/nm-setting-match.c b/src/libnm-core-impl/nm-setting-match.c index 0ece65f15b..628c44f921 100644 --- a/src/libnm-core-impl/nm-setting-match.c +++ b/src/libnm-core-impl/nm-setting-match.c @@ -718,19 +718,6 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) return TRUE; } -static void -finalize(GObject *object) -{ - NMSettingMatch *self = NM_SETTING_MATCH(object); - - nm_clear_pointer(&self->interface_name.arr, g_array_unref); - nm_clear_pointer(&self->kernel_command_line.arr, g_array_unref); - nm_clear_pointer(&self->driver.arr, g_array_unref); - nm_clear_pointer(&self->path.arr, g_array_unref); - - G_OBJECT_CLASS(nm_setting_match_parent_class)->finalize(object); -} - static void nm_setting_match_class_init(NMSettingMatchClass *klass) { @@ -740,7 +727,6 @@ nm_setting_match_class_init(NMSettingMatchClass *klass) object_class->get_property = _nm_setting_property_get_property_direct; object_class->set_property = _nm_setting_property_set_property_direct; - object_class->finalize = finalize; setting_class->verify = verify;