diff options
| author | Michael Biebl <biebl@debian.org> | 2016-05-11 17:09:14 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-05-11 17:09:14 +0200 |
| commit | c74718aa5a356199a1ff957b2579153d54be9dd5 (patch) | |
| tree | cf3ade8c1e7322792ec140f09ee5e083382c5c48 /libnm-core/nm-connection.c | |
| parent | 6bb523977deede318916fe01c78f776d215cebff (diff) | |
| parent | 73e152af6e3fb4f5848bfb8394484026ff119003 (diff) | |
Merge tag 'upstream/1.2.2'
Upstream version 1.2.2
Diffstat (limited to 'libnm-core/nm-connection.c')
| -rw-r--r-- | libnm-core/nm-connection.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index c03e6265..7a0e1f6b 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -2240,13 +2240,19 @@ nm_connection_private_free (NMConnectionPrivate *priv) static NMConnectionPrivate * nm_connection_get_private (NMConnection *connection) { + static GQuark key = 0; NMConnectionPrivate *priv; - priv = g_object_get_data (G_OBJECT (connection), "NMConnectionPrivate"); + nm_assert (NM_IS_CONNECTION (connection)); + + if (G_UNLIKELY (key == 0)) + key = g_quark_from_static_string ("NMConnectionPrivate"); + + priv = g_object_get_qdata ((GObject *) connection, key); if (!priv) { priv = g_slice_new0 (NMConnectionPrivate); - g_object_set_data_full (G_OBJECT (connection), "NMConnectionPrivate", - priv, (GDestroyNotify) nm_connection_private_free); + g_object_set_qdata_full ((GObject *) connection, key, + priv, (GDestroyNotify) nm_connection_private_free); priv->self = connection; priv->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); |