mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 11:00:18 +01:00
2007-09-23 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c - (property_value_destroy, nm_setting_vpn_properties_new): initialize the hash table in a standard manner. Clients of libnm-util should only call g_hash_table_remove_all(), never destroy the hash table and recreate it. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2859 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
7aa5d524c5
commit
4a7fb5f0b3
2 changed files with 23 additions and 0 deletions
|
|
@ -1,3 +1,11 @@
|
|||
2007-09-23 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* libnm-util/nm-setting.c
|
||||
- (property_value_destroy, nm_setting_vpn_properties_new): initialize
|
||||
the hash table in a standard manner. Clients of libnm-util should
|
||||
only call g_hash_table_remove_all(), never destroy the hash table
|
||||
and recreate it.
|
||||
|
||||
2007-09-22 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-device-802-11-wireless.c
|
||||
|
|
|
|||
|
|
@ -1248,6 +1248,15 @@ setting_vpn_properties_destroy (NMSetting *setting)
|
|||
g_slice_free (NMSettingVPNProperties, self);
|
||||
}
|
||||
|
||||
static void
|
||||
property_value_destroy (gpointer data)
|
||||
{
|
||||
GValue *value = (GValue *) data;
|
||||
|
||||
g_value_unset (value);
|
||||
g_slice_free (GValue, data);
|
||||
}
|
||||
|
||||
static SettingMember vpn_properties_table[] = {
|
||||
{ "data", NM_S_TYPE_GVALUE_HASH, G_STRUCT_OFFSET (NMSettingVPNProperties, data), TRUE, FALSE },
|
||||
{ NULL, 0, 0 },
|
||||
|
|
@ -1257,6 +1266,7 @@ NMSetting *
|
|||
nm_setting_vpn_properties_new (void)
|
||||
{
|
||||
NMSetting *setting;
|
||||
NMSettingVPNProperties *s_vpn_props;
|
||||
|
||||
setting = (NMSetting *) g_slice_new0 (NMSettingVPNProperties);
|
||||
|
||||
|
|
@ -1266,6 +1276,11 @@ nm_setting_vpn_properties_new (void)
|
|||
setting->hash_fn = setting_vpn_properties_hash;
|
||||
setting->destroy_fn = setting_vpn_properties_destroy;
|
||||
|
||||
s_vpn_props = (NMSettingVPNProperties *) setting;
|
||||
s_vpn_props->data = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
property_value_destroy);
|
||||
|
||||
return setting;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue