diff options
author | Thomas Haller <thaller@redhat.com> | 2019-06-21 09:51:15 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-06-26 09:53:54 +0200 |
commit | d704f02119a888bd0a43b0ce0fac7d1ddc5d2df7 (patch) | |
tree | 757af627cd77012da896f00f39e4782f57d5d63e /libnm-core/nm-core-internal.h | |
parent | b9587008fcebb5255119a457f708c7f7d1232fa1 (diff) | |
download | NetworkManager-d704f02119a888bd0a43b0ce0fac7d1ddc5d2df7.tar.gz |
libnm: workaround assertion failure for nmtst_connection_assert_unchanging() when disposing connection
nmtst_connection_assert_unchanging() registers to the changed signals
and asserts that they are not invoked. The purpose is that sometimes
we want to keep a reference to an NMConnection and be sure that it does
not get modified. This allows everybody to keep a reference to the very
same connection instance without cloning it -- provided they too promise
not to change it. This assert is to ensure that.
Note that NMSimpleConnection.dispose() clears the secrets and thus upon
destruction the assertion fails. At that point, the assertion is no longer
relevant, because the purpose was to ensure that no alive instances gets
modified. While destroying the instance, it's fine to modify it (nobody should
have a reference to it anymore).
This avoids the assertion failure when destroying a NMSimpleConnection with secrets
that is set with nmtst_connection_assert_unchanging().
Diffstat (limited to 'libnm-core/nm-core-internal.h')
-rw-r--r-- | libnm-core/nm-core-internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index eaf29849cf..60e13937de 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -212,6 +212,7 @@ gboolean _nm_connection_ensure_normalized (NMConnection *connection, gboolean _nm_connection_remove_setting (NMConnection *connection, GType setting_type); #if NM_MORE_ASSERTS +extern const char _nmtst_connection_unchanging_user_data; void nmtst_connection_assert_unchanging (NMConnection *connection); #else static inline void |